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