Don't include cdda code if HAVE_AUDIOCD isn't defined
This commit is contained in:
parent
3616a50d83
commit
236cfa7adf
|
@ -34,11 +34,13 @@
|
||||||
#include "core/mac_startup.h"
|
#include "core/mac_startup.h"
|
||||||
#include "core/signalchecker.h"
|
#include "core/signalchecker.h"
|
||||||
#include "core/utilities.h"
|
#include "core/utilities.h"
|
||||||
|
#ifdef HAVE_AUDIOCD
|
||||||
#include "devices/cddadevice.h"
|
#include "devices/cddadevice.h"
|
||||||
|
#endif
|
||||||
#include "internet/core/internetmodel.h"
|
#include "internet/core/internetmodel.h"
|
||||||
#ifdef HAVE_SPOTIFY
|
#ifdef HAVE_SPOTIFY
|
||||||
# include "internet/spotify/spotifyserver.h"
|
#include "internet/spotify/spotifyserver.h"
|
||||||
# include "internet/spotify/spotifyservice.h"
|
#include "internet/spotify/spotifyservice.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const int GstEnginePipeline::kGstStateTimeoutNanosecs = 10000000;
|
const int GstEnginePipeline::kGstStateTimeoutNanosecs = 10000000;
|
||||||
|
@ -161,6 +163,13 @@ bool GstEnginePipeline::ReplaceDecodeBin(const QUrl& url) {
|
||||||
return ReplaceDecodeBin(new_bin);
|
return ReplaceDecodeBin(new_bin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QByteArray GstEnginePipeline::GstUriFromUrl(const QUrl& url) {
|
||||||
|
#ifdef HAVE_AUDIOCD
|
||||||
|
if (url.scheme() == "cdda") return CddaDevice::TrackUrlToStr(url).toUtf8();
|
||||||
|
#endif
|
||||||
|
return Utilities::GetUriForGstreamer(url);
|
||||||
|
}
|
||||||
|
|
||||||
GstElement* GstEnginePipeline::CreateDecodeBinFromUrl(const QUrl& url) {
|
GstElement* GstEnginePipeline::CreateDecodeBinFromUrl(const QUrl& url) {
|
||||||
GstElement* new_bin = nullptr;
|
GstElement* new_bin = nullptr;
|
||||||
#ifdef HAVE_SPOTIFY
|
#ifdef HAVE_SPOTIFY
|
||||||
|
@ -202,12 +211,7 @@ GstElement* GstEnginePipeline::CreateDecodeBinFromUrl(const QUrl& url) {
|
||||||
Q_ARG(QString, url.toString()), Q_ARG(quint16, port));
|
Q_ARG(QString, url.toString()), Q_ARG(quint16, port));
|
||||||
} else {
|
} else {
|
||||||
#endif
|
#endif
|
||||||
QByteArray uri;
|
QByteArray uri = GstUriFromUrl(url);
|
||||||
if (url.scheme() == "cdda") {
|
|
||||||
uri = CddaDevice::TrackUrlToStr(url).toUtf8();
|
|
||||||
} else {
|
|
||||||
uri = Utilities::GetUriForGstreamer(url);
|
|
||||||
}
|
|
||||||
new_bin = engine_->CreateElement("uridecodebin");
|
new_bin = engine_->CreateElement("uridecodebin");
|
||||||
if (!new_bin) return nullptr;
|
if (!new_bin) return nullptr;
|
||||||
g_object_set(G_OBJECT(new_bin), "uri", uri.constData(), nullptr);
|
g_object_set(G_OBJECT(new_bin), "uri", uri.constData(), nullptr);
|
||||||
|
@ -525,6 +529,7 @@ bool GstEnginePipeline::InitFromReq(const MediaPlaybackRequest& req,
|
||||||
|
|
||||||
current_ = req;
|
current_ = req;
|
||||||
QUrl url = current_.url_;
|
QUrl url = current_.url_;
|
||||||
|
#ifdef HAVE_AUDIOCD
|
||||||
if (url.scheme() == "cdda" && !url.path().isEmpty()) {
|
if (url.scheme() == "cdda" && !url.path().isEmpty()) {
|
||||||
// Currently, Gstreamer can't handle input CD devices inside cdda URL. So
|
// Currently, Gstreamer can't handle input CD devices inside cdda URL. So
|
||||||
// we handle them ourself: we extract the track number and re-create an
|
// we handle them ourself: we extract the track number and re-create an
|
||||||
|
@ -535,6 +540,7 @@ bool GstEnginePipeline::InitFromReq(const MediaPlaybackRequest& req,
|
||||||
url = QUrl(QString("cdda://%1").arg(path.takeLast()));
|
url = QUrl(QString("cdda://%1").arg(path.takeLast()));
|
||||||
source_device_ = path.join("/");
|
source_device_ = path.join("/");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
end_offset_nanosec_ = end_nanosec;
|
end_offset_nanosec_ = end_nanosec;
|
||||||
|
|
||||||
// Decode bin
|
// Decode bin
|
||||||
|
|
|
@ -141,6 +141,8 @@ signals:
|
||||||
gpointer);
|
gpointer);
|
||||||
static void TaskEnterCallback(GstTask*, GThread*, gpointer);
|
static void TaskEnterCallback(GstTask*, GThread*, gpointer);
|
||||||
|
|
||||||
|
static QByteArray GstUriFromUrl(const QUrl& url);
|
||||||
|
|
||||||
void TagMessageReceived(GstMessage*);
|
void TagMessageReceived(GstMessage*);
|
||||||
void ErrorMessageReceived(GstMessage*);
|
void ErrorMessageReceived(GstMessage*);
|
||||||
void ElementMessageReceived(GstMessage*);
|
void ElementMessageReceived(GstMessage*);
|
||||||
|
|
Loading…
Reference in New Issue