Append id to spotify_bin gst_bin.

This commit is contained in:
Andreas 2015-04-21 11:47:32 +02:00
parent e916db9ae1
commit dd2ba0fe33
3 changed files with 8 additions and 2 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -291,6 +291,8 @@ signals:
QThreadPool set_state_threadpool_;
GstSegment last_decodebin_segment_;
int spotify_id_;
};
#endif // GSTENGINEPIPELINE_H