Don't modify the original request URLs when doing cdda fixup

The current URL is compared againt the unmodified next in some cases.
This commit is contained in:
Jim Broadus 2020-05-31 22:16:59 -07:00 committed by John Maguire
parent 7e3cd84b5d
commit 3616a50d83
1 changed files with 5 additions and 4 deletions

View File

@ -524,20 +524,21 @@ bool GstEnginePipeline::InitFromReq(const MediaPlaybackRequest& req,
pipeline_ = gst_pipeline_new("pipeline"); pipeline_ = gst_pipeline_new("pipeline");
current_ = req; current_ = req;
if (current_.url_.scheme() == "cdda" && !current_.url_.path().isEmpty()) { QUrl url = current_.url_;
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
// URL with only cdda:// + the track number (which can be handled by // URL with only cdda:// + the track number (which can be handled by
// Gstreamer). We keep the device in mind, and we will set it later using // Gstreamer). We keep the device in mind, and we will set it later using
// SourceSetupCallback // SourceSetupCallback
QStringList path = current_.url_.path().split('/'); QStringList path = url.path().split('/');
current_.url_ = QUrl(QString("cdda://%1").arg(path.takeLast())); url = QUrl(QString("cdda://%1").arg(path.takeLast()));
source_device_ = path.join("/"); source_device_ = path.join("/");
} }
end_offset_nanosec_ = end_nanosec; end_offset_nanosec_ = end_nanosec;
// Decode bin // Decode bin
if (!ReplaceDecodeBin(current_.url_)) return false; if (!ReplaceDecodeBin(url)) return false;
return Init(); return Init();
} }