From 43e7de19358f730ee18d690a993e97a5195b80c9 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 29 Jul 2021 05:16:57 +0200 Subject: Faster video loading/error when not using xxx plugin (disable ytdl) --- include/QuickMedia.hpp | 1 + include/VideoPlayer.hpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp index 765a346..0cd65b4 100644 --- a/include/QuickMedia.hpp +++ b/include/QuickMedia.hpp @@ -210,5 +210,6 @@ namespace QuickMedia { std::filesystem::path file_manager_start_dir; std::string youtube_url; std::unique_ptr video_player; + bool use_youtube_dl = false; }; } \ No newline at end of file diff --git a/include/VideoPlayer.hpp b/include/VideoPlayer.hpp index bdf3344..cd1e979 100644 --- a/include/VideoPlayer.hpp +++ b/include/VideoPlayer.hpp @@ -41,7 +41,7 @@ namespace QuickMedia { VideoPlayer& operator=(const VideoPlayer&) = delete; // |audio_path| is only set when video and audio are separate files/urls. - Error load_video(const char *path, const char *audio_path, sf::WindowHandle parent_window, bool is_youtube, const std::string &title, const std::string &start_time = "", const std::vector &chapters = {}); + Error load_video(const char *path, const char *audio_path, sf::WindowHandle parent_window, bool use_youtube_dl, const std::string &title, const std::string &start_time = "", const std::vector &chapters = {}); // Should be called every update frame Error update(); @@ -54,13 +54,14 @@ namespace QuickMedia { int exit_status; private: Error send_command(const char *cmd, size_t size); - Error launch_video_process(const char *path, const char *audio_path, sf::WindowHandle parent_window, bool is_youtube, const std::string &title, const std::string &start_time); + Error launch_video_process(const char *path, const char *audio_path, sf::WindowHandle parent_window, const std::string &title, const std::string &start_time); VideoPlayer::Error read_ipc_func(); private: std::string plugin_name; bool no_video; bool use_system_mpv_config; bool keep_open; + bool use_youtube_dl; pid_t video_process_id; bool connected_to_ipc; sf::Clock retry_timer; -- cgit v1.2.3