From ce5c0ef8aa8eec45e31ad6697f5d94dd1727a984 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 25 Aug 2023 10:55:08 +0200 Subject: Reduce latency (in mglpp, opengl hack) --- depends/mglpp | 2 +- include/QuickMedia.hpp | 2 -- src/QuickMedia.cpp | 17 ++++++----------- src/VideoPlayer.cpp | 1 + 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/depends/mglpp b/depends/mglpp index f91ac8b..bca32ff 160000 --- a/depends/mglpp +++ b/depends/mglpp @@ -1 +1 @@ -Subproject commit f91ac8b0fcc801bc6b2d04ebaeffe1feee4437f2 +Subproject commit bca32ff4b62dde07063546c5998bf42812690839 diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp index 0a21e07..0f8837d 100644 --- a/include/QuickMedia.hpp +++ b/include/QuickMedia.hpp @@ -242,7 +242,5 @@ namespace QuickMedia { int video_max_height = 0; std::mutex login_inputs_mutex; const char *yt_dl_name = nullptr; - - int monitor_max_fps = 0; }; } diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 04ba62f..14efedb 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -803,12 +803,6 @@ namespace QuickMedia { XSetErrorHandler(x_error_handler); XSetIOErrorHandler(x_io_error_handler); - monitor_max_fps = 0; - for_each_active_monitor_output(disp, [&](const XRRCrtcInfo*, const XRRModeInfo *mode_info) { - monitor_max_fps = std::max(monitor_max_fps, monitor_info_get_fps(mode_info)); - }); - - window.set_framerate_limit(monitor_max_fps); idle = false; if(create_directory_recursive(get_cache_dir().join("media")) != 0) { @@ -1466,7 +1460,7 @@ namespace QuickMedia { void Program::idle_active_handler() { if(idle) - window.set_framerate_limit(monitor_max_fps); + window.set_framerate_limit(0); idle = false; idle_timer.restart(); @@ -3274,10 +3268,11 @@ namespace QuickMedia { redirect_focus_to_video_player_window(video_player_window); XSync(disp, False); - SubtitleData subtitle_data; - video_page->get_subtitles(subtitle_data); - if(!subtitle_data.url.empty()) - video_player->add_subtitle(subtitle_data.url, subtitle_data.title, "eng"); + // TODO: Readd when we no longer depend on yt-dlp + //SubtitleData subtitle_data; + //video_page->get_subtitles(subtitle_data); + //if(!subtitle_data.url.empty()) + // video_player->add_subtitle(subtitle_data.url, subtitle_data.title, "eng"); update_time_pos = true; update_window_focus_timer = true; diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp index 9036155..26946fc 100644 --- a/src/VideoPlayer.cpp +++ b/src/VideoPlayer.cpp @@ -235,6 +235,7 @@ namespace QuickMedia { if(startup_args.use_youtube_dl) { args.push_back("--ytdl=yes"); args.push_back(ytdl_format.c_str()); + //args.push_back("--ytdl-raw-options=sub-lang=\"en,eng,enUS,en-US\",write-sub="); } else { args.push_back("--ytdl=no"); } -- cgit v1.2.3