From c946c1d1c40e1834b11f16afab321dc5de6e45c4 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Tue, 12 Oct 2021 22:59:23 +0200 Subject: [PATCH] Player: Don't preload next song while playing module music Workaround bug in GStreamer Fixes #787 Fixes #772 --- src/core/player.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/player.cpp b/src/core/player.cpp index 3ca45a6d1..49fbb09cf 100644 --- a/src/core/player.cpp +++ b/src/core/player.cpp @@ -338,7 +338,7 @@ void Player::HandleLoadResult(const UrlHandler::LoadResult &result) { current_item_ = item; play_offset_nanosec_ = 0; } - else if (is_next) { + else if (is_next && !item->Metadata().is_module_music()) { qLog(Debug) << "Preloading next song" << next_item->Metadata().title() << result.stream_url_; engine_->StartPreloading(result.stream_url_, next_item->Url(), song.has_cue(), song.beginning_nanosec(), song.end_nanosec()); } @@ -856,6 +856,12 @@ void Player::TrackAboutToEnd() { } } + // Preloading any format while currently playing module music is broken in GStreamer. + // See: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/769 + if (current_item_ && current_item_->Metadata().is_module_music()) { + return; + } + engine_->StartPreloading(url, next_item->Url(), next_item->Metadata().has_cue(), next_item->effective_beginning_nanosec(), next_item->effective_end_nanosec()); }