aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-07-29 05:16:57 +0200
committerdec05eba <dec05eba@protonmail.com>2021-07-29 05:16:57 +0200
commit43e7de19358f730ee18d690a993e97a5195b80c9 (patch)
treea132a8cf5784d7a62a58dc08acf9a0e062bc5539 /include
parentda9836a92ef69bb93e521985976db0322e2d5316 (diff)
Faster video loading/error when not using xxx plugin (disable ytdl)
Diffstat (limited to 'include')
-rw-r--r--include/QuickMedia.hpp1
-rw-r--r--include/VideoPlayer.hpp5
2 files changed, 4 insertions, 2 deletions
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<VideoPlayer> 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<MediaChapter> &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<MediaChapter> &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;