From dd2ba0fe3388a16561f9d6995aa6b5f93eb4939f Mon Sep 17 00:00:00 2001 From: Andreas Date: Tue, 21 Apr 2015 11:47:32 +0200 Subject: [PATCH] Append id to spotify_bin gst_bin. --- ext/clementine-spotifyblob/spotifyclient.cpp | 1 + src/engines/gstenginepipeline.cpp | 7 +++++-- src/engines/gstenginepipeline.h | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ext/clementine-spotifyblob/spotifyclient.cpp b/ext/clementine-spotifyblob/spotifyclient.cpp index 0785770f8..f4732ed3a 100644 --- a/ext/clementine-spotifyblob/spotifyclient.cpp +++ b/ext/clementine-spotifyblob/spotifyclient.cpp @@ -824,6 +824,7 @@ int SpotifyClient::MusicDeliveryCallback(sp_session* session, } if (!me->media_pipeline_->is_accepting_data()) { + qLog(Info) << "Pipeline not accepting data"; return 0; } diff --git a/src/engines/gstenginepipeline.cpp b/src/engines/gstenginepipeline.cpp index f6237dbfd..e21cef7da 100644 --- a/src/engines/gstenginepipeline.cpp +++ b/src/engines/gstenginepipeline.cpp @@ -89,7 +89,8 @@ GstEnginePipeline::GstEnginePipeline(GstEngine* engine) stereo_panorama_(nullptr), volume_(nullptr), audioscale_(nullptr), - audiosink_(nullptr) { + audiosink_(nullptr), + spotify_id_(0) { if (!sElementDeleter) { sElementDeleter = new GstElementDeleter; } @@ -147,7 +148,9 @@ bool GstEnginePipeline::ReplaceDecodeBin(const QUrl& url) { GstElement* new_bin = nullptr; if (url.scheme() == "spotify") { - new_bin = gst_bin_new("spotify_bin"); + QString name = "spotify_bin_" + QString::number(spotify_id_++); + qLog(Debug) << "Spotify bin name: " << name; + new_bin = gst_bin_new(name.toAscii().constData()); // Create elements GstElement* src = engine_->CreateElement("tcpserversrc", new_bin); diff --git a/src/engines/gstenginepipeline.h b/src/engines/gstenginepipeline.h index c44602adc..35f0c118c 100644 --- a/src/engines/gstenginepipeline.h +++ b/src/engines/gstenginepipeline.h @@ -291,6 +291,8 @@ signals: QThreadPool set_state_threadpool_; GstSegment last_decodebin_segment_; + + int spotify_id_; }; #endif // GSTENGINEPIPELINE_H