mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-23 19:49:05 +08:00
fix hwcodec ram quality change not work (#10024)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
parent
02c274aeb6
commit
02b046bdbf
@ -70,7 +70,7 @@ impl EncoderApi for HwRamEncoder {
|
||||
let b = Self::convert_quality(&config.name, config.quality);
|
||||
let base_bitrate = base_bitrate(config.width as _, config.height as _);
|
||||
let mut bitrate = base_bitrate * b / 100;
|
||||
if base_bitrate <= 0 {
|
||||
if bitrate <= 0 {
|
||||
bitrate = base_bitrate;
|
||||
}
|
||||
bitrate = Self::check_bitrate_range(&config, bitrate);
|
||||
@ -180,7 +180,7 @@ impl EncoderApi for HwRamEncoder {
|
||||
let b = Self::convert_quality(&self.config.name, quality);
|
||||
let mut bitrate = base_bitrate(self.config.width as _, self.config.height as _) * b / 100;
|
||||
if bitrate > 0 {
|
||||
bitrate = Self::check_bitrate_range(&self.config, self.bitrate);
|
||||
bitrate = Self::check_bitrate_range(&self.config, bitrate);
|
||||
self.encoder.set_bitrate(bitrate as _).ok();
|
||||
self.bitrate = bitrate;
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ impl EncoderApi for VRamEncoder {
|
||||
let b = Self::convert_quality(config.quality, &config.feature);
|
||||
let base_bitrate = base_bitrate(config.width as _, config.height as _);
|
||||
let mut bitrate = base_bitrate * b / 100;
|
||||
if base_bitrate <= 0 {
|
||||
if bitrate <= 0 {
|
||||
bitrate = base_bitrate;
|
||||
}
|
||||
let gop = config.keyframe_interval.unwrap_or(MAX_GOP as _) as i32;
|
||||
|
Loading…
Reference in New Issue
Block a user