Fix compilation errors when compiling without spotify

This commit is contained in:
David Sansome 2011-11-28 19:09:30 +00:00
parent ac285eeeae
commit 5ee6064a50
1 changed files with 32 additions and 23 deletions

View File

@ -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"
#include "internet/spotifyserver.h"
#include "internet/spotifyservice.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);