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.
This commit is contained in:
Bart De Vries 2021-04-23 10:55:59 +02:00
parent e2d59a69b0
commit 51db7ea1cf
1 changed files with 7 additions and 0 deletions

View File

@ -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();