Fix compilation errors when compiling without spotify
This commit is contained in:
parent
ac285eeeae
commit
5ee6064a50
@ -18,14 +18,18 @@
|
||||
#include <limits>
|
||||
|
||||
#include "bufferconsumer.h"
|
||||
#include "config.h"
|
||||
#include "gstelementdeleter.h"
|
||||
#include "gstengine.h"
|
||||
#include "gstenginepipeline.h"
|
||||
#include "core/logging.h"
|
||||
#include "core/utilities.h"
|
||||
#include "internet/internetmodel.h"
|
||||
|
||||
#ifdef HAVE_SPOTIFY
|
||||
# include "internet/spotifyserver.h"
|
||||
# include "internet/spotifyservice.h"
|
||||
#endif
|
||||
|
||||
#include <QtConcurrentRun>
|
||||
|
||||
@ -128,6 +132,7 @@ bool GstEnginePipeline::ReplaceDecodeBin(const QUrl& url) {
|
||||
GstElement* new_bin = NULL;
|
||||
|
||||
if (url.scheme() == "spotify") {
|
||||
#ifdef HAVE_SPOTIFY
|
||||
new_bin = gst_bin_new("spotify_bin");
|
||||
|
||||
// Create elements
|
||||
@ -151,6 +156,10 @@ bool GstEnginePipeline::ReplaceDecodeBin(const QUrl& url) {
|
||||
|
||||
// Tell spotify to start sending data to us.
|
||||
InternetModel::Service<SpotifyService>()->server()->StartPlaybackLater(url.toString(), port);
|
||||
#else // HAVE_SPOTIFY
|
||||
qLog(Error) << "Tried to play a spotify:// url, but spotify support is not compiled in";
|
||||
return false;
|
||||
#endif
|
||||
} else {
|
||||
new_bin = engine_->CreateElement("uridecodebin");
|
||||
g_object_set(G_OBJECT(new_bin), "uri", url.toEncoded().constData(), NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user