mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-02-21 00:39:59 +00:00
Avoid recreating the display when no display parameters have changed
This commit is contained in:
parent
aee88f336a
commit
8373a8b947
@ -2353,12 +2353,7 @@ namespace video {
|
|||||||
};
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
validate_config(std::shared_ptr<platf::display_t> &disp, const encoder_t &encoder, const config_t &config) {
|
validate_config(std::shared_ptr<platf::display_t> disp, const encoder_t &encoder, const config_t &config) {
|
||||||
reset_display(disp, encoder.platform_formats->dev_type, config::video.output_name, config);
|
|
||||||
if (!disp) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto encode_device = make_encode_device(*disp, encoder, config);
|
auto encode_device = make_encode_device(*disp, encoder, config);
|
||||||
if (!encode_device) {
|
if (!encode_device) {
|
||||||
return -1;
|
return -1;
|
||||||
@ -2561,6 +2556,12 @@ namespace video {
|
|||||||
hevc.videoFormat = 1;
|
hevc.videoFormat = 1;
|
||||||
av1.videoFormat = 2;
|
av1.videoFormat = 2;
|
||||||
|
|
||||||
|
// Reset the display since we're switching from SDR to HDR
|
||||||
|
reset_display(disp, encoder.platform_formats->dev_type, config::video.output_name, config);
|
||||||
|
if (!disp) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// HDR is not supported with H.264. Don't bother even trying it.
|
// HDR is not supported with H.264. Don't bother even trying it.
|
||||||
encoder.h264[flag] = flag != encoder_t::DYNAMIC_RANGE && validate_config(disp, encoder, h264) >= 0;
|
encoder.h264[flag] = flag != encoder_t::DYNAMIC_RANGE && validate_config(disp, encoder, h264) >= 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user