aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-06-16 09:51:21 +0200
committerdec05eba <dec05eba@protonmail.com>2021-06-16 09:51:21 +0200
commitc3b6ae0e1fa52fd82e0b18bf44bff6540e7a1555 (patch)
tree026c3f30d8a45458c07ab61d39f0ee3e3bdc2c31 /src
parent9908a7dc298cc9c20a99e3423bdb531b86a7eb56 (diff)
Choose another audio source for youtube to workaround freezing after seek
Diffstat (limited to 'src')
-rw-r--r--src/QuickMedia.cpp2
-rw-r--r--src/plugins/Youtube.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 4265310..646d065 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -2487,7 +2487,7 @@ namespace QuickMedia {
bool in_seeking = false;
sf::Clock seeking_start_timer;
- const float seeking_restart_timeout_sec = 4.0f; // TODO: Test if this timeout is good on slow hardware such as pinephone and slow internet
+ const float seeking_restart_timeout_sec = 10.0f; // TODO: Test if this timeout is good on slow hardware such as pinephone and slow internet
const int num_load_tries_max = 3;
int load_try = 0;
diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp
index 1f8c103..f113e0c 100644
--- a/src/plugins/Youtube.cpp
+++ b/src/plugins/Youtube.cpp
@@ -1886,7 +1886,8 @@ namespace QuickMedia {
if(audio_formats.empty())
return "";
- const YoutubeAudioFormat *chosen_audio_format = &audio_formats.front();
+ // TODO: The "worst" (but still good) quality audio is chosen right now because youtube seeking freezes for up to 15 seconds when choosing the best quality
+ const YoutubeAudioFormat *chosen_audio_format = &audio_formats.back();
fprintf(stderr, "Choosing youtube audio format: bitrate: %d, mime type: %s\n", chosen_audio_format->base.bitrate, chosen_audio_format->base.mime_type.c_str());
return chosen_audio_format->base.url;
}