mirror of
https://github.com/LizardByte/Sunshine.git
synced 2026-08-07 18:36:34 +00:00
fix(video): restore the ability to set a minimum fps target (#4114)
This commit is contained in:
+5
-4
@@ -1890,9 +1890,10 @@ namespace video {
|
||||
}
|
||||
});
|
||||
|
||||
// set minimum frame time based on client-requested target framerate
|
||||
std::chrono::duration<double, std::milli> minimum_frame_time {1000.0 / config.framerate};
|
||||
BOOST_LOG(info) << "Minimum frame time set to "sv << minimum_frame_time.count() << "ms, based on client-requested target framerate "sv << config.framerate << "."sv;
|
||||
// set max frame time based on client-requested target framerate.
|
||||
double minimum_fps_target = (config::video.minimum_fps_target > 0.0) ? config::video.minimum_fps_target : config.framerate;
|
||||
std::chrono::duration<double, std::milli> max_frametime {1000.0 / minimum_fps_target};
|
||||
BOOST_LOG(info) << "Minimum FPS target set to ~"sv << (minimum_fps_target / 2) << "fps ("sv << max_frametime.count() * 2 << "ms)"sv;
|
||||
|
||||
auto shutdown_event = mail->event<bool>(mail::shutdown);
|
||||
auto packets = mail::man->queue<packet_t>(mail::video_packets);
|
||||
@@ -1943,7 +1944,7 @@ namespace video {
|
||||
|
||||
// Encode at a minimum FPS to avoid image quality issues with static content
|
||||
if (!requested_idr_frame || images->peek()) {
|
||||
if (auto img = images->pop(minimum_frame_time)) {
|
||||
if (auto img = images->pop(max_frametime)) {
|
||||
frame_timestamp = img->frame_timestamp;
|
||||
if (session->convert(*img)) {
|
||||
BOOST_LOG(error) << "Could not convert image"sv;
|
||||
|
||||
Reference in New Issue
Block a user