From b6b4db460ce5bfdfe7c4e46a89ef370b6cc31752 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 4 May 2021 12:37:22 +0200 Subject: Use x11 on wayland, to make mpv embedding possible --- src/QuickMedia.cpp | 9 +++------ src/VideoPlayer.cpp | 1 + src/plugins/Manganelo.cpp | 2 +- src/plugins/Youtube.cpp | 4 ---- 4 files changed, 5 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index aebe86e..5ffc3f6 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -2312,14 +2312,11 @@ namespace QuickMedia { bool cursor_visible = true; sf::Clock cursor_hide_timer; - auto save_video_url_to_clipboard = [&original_video_url, &video_player_window, &video_player]() { - if(!video_player_window) - return; - + auto save_video_url_to_clipboard = [&original_video_url, &video_player]() { if(video_url_supports_timestamp(original_video_url)) { // TODO: Remove timestamp (&t= or ?t=) from video_url - double time_in_file; - if(video_player->get_time_in_file(&time_in_file) != VideoPlayer::Error::OK) + double time_in_file = 0.0; + if(video_player && (video_player->get_time_in_file(&time_in_file) != VideoPlayer::Error::OK)) time_in_file = 0.0; std::string clipboard = original_video_url; diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp index 3f3df0c..a6f3640 100644 --- a/src/VideoPlayer.cpp +++ b/src/VideoPlayer.cpp @@ -109,6 +109,7 @@ namespace QuickMedia { ytdl_format.c_str(), // TODO: Disable hr seek on low power devices? "--hr-seek=yes", + "--gpu-context=x11egl", input_conf.c_str(), wid_arg.c_str() }); diff --git a/src/plugins/Manganelo.cpp b/src/plugins/Manganelo.cpp index e6bdfc0..960caaf 100644 --- a/src/plugins/Manganelo.cpp +++ b/src/plugins/Manganelo.cpp @@ -200,7 +200,7 @@ namespace QuickMedia { const char *href = quickmedia_html_node_get_attribute_value(node, "href"); const char *title = quickmedia_html_node_get_attribute_value(node, "title"); if(href && title && strstr(href, "/manga/")) { - auto body_item = BodyItem::create(title); + auto body_item = BodyItem::create(strip(title)); body_item->url = strip(href); item_data->push_back(std::move(body_item)); } diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp index 6149b84..cbe6b81 100644 --- a/src/plugins/Youtube.cpp +++ b/src/plugins/Youtube.cpp @@ -241,10 +241,6 @@ namespace QuickMedia { if(!desc.empty()) desc += " • "; desc += video_count.value(); - if(strcmp(video_count.value().c_str(), "1") == 0) - desc += " video"; - else - desc += " videos"; } if(description) { if(!desc.empty()) -- cgit v1.2.3