From 51db7ea1cfddf03ad8ab6591b71caf98cd0afcd4 Mon Sep 17 00:00:00 2001 From: Bart De Vries Date: Fri, 23 Apr 2021 10:55:59 +0200 Subject: [PATCH] Only use custom gst-pipeline on linux GStreamer is not used as QMediaPlayer backend on other platforms, so audio will not start with a custom gst-pipeline on Android and Windows. Still needs a solution to get rid of the horrible pitch change on Android and Windows, though. --- src/audiomanager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/audiomanager.cpp b/src/audiomanager.cpp index 1e8688a3..93341653 100644 --- a/src/audiomanager.cpp +++ b/src/audiomanager.cpp @@ -185,7 +185,14 @@ void AudioManager::setEntry(Entry* entry) Q_EMIT entryChanged(entry); // the gst-pipeline is required to make sure that the pitch is not // changed when speeding up the audio stream + // TODO: find a solution for Android (GStreamer not available on android by default) +#if !defined Q_OS_ANDROID && !defined Q_OS_WIN + //qDebug() << "use custom pipeline"; d->m_player.setMedia(QUrl(QStringLiteral("gst-pipeline: playbin uri=file://") + d->m_entry->enclosure()->path() + QStringLiteral(" audio_sink=\"scaletempo ! audioconvert ! audioresample ! autoaudiosink\" video_sink=\"fakevideosink\""))); +#else + //qDebug() << "regular audio backend"; + d->m_player.setMedia(QUrl(QStringLiteral("file://")+d->m_entry->enclosure()->path())); +#endif // save the current playing track in the settingsfile for restoring on startup DataManager::instance().setLastPlayingEntry(d->m_entry->id()); //qDebug() << "Changed source to" << d->m_entry->title();