GstEnginePipeline: Disable volume sync on Windows

Fixes #1220
This commit is contained in:
Jonas Kvinge 2023-08-01 16:39:57 +02:00
parent 560712db21
commit 2a90256d32
1 changed files with 9 additions and 1 deletions

View File

@ -322,15 +322,21 @@ bool GstEnginePipeline::InitFromUrl(const QUrl &media_url, const QUrl &stream_ur
if (!InitAudioBin(error)) return false;
#ifdef Q_OS_WIN32
if (volume_enabled_ && !volume_ && volume_sw_) {
SetupVolume(volume_sw_);
}
#else
if (volume_enabled_ && !volume_) {
if (output_ == GstEngine::kAutoSink) {
element_added_cb_id_ = CHECKED_GCONNECT(G_OBJECT(audiobin_), "deep-element-added", &ElementAddedCallback, this);
}
else {
else if (volume_sw_) {
qLog(Debug) << output_ << "does not have volume, using own volume.";
SetupVolume(volume_sw_);
}
}
#endif
// Set playbin's sink to be our custom audio-sink.
g_object_set(GST_OBJECT(pipeline_), "audio-sink", audiobin_, nullptr);
@ -471,10 +477,12 @@ bool GstEnginePipeline::InitAudioBin(QString &error) {
}
#ifndef Q_OS_WIN32
if (g_object_class_find_property(G_OBJECT_GET_CLASS(audiosink_), "volume")) {
qLog(Debug) << output_ << "has volume, enabling volume synchronization.";
SetupVolume(audiosink_);
}
#endif
// Create all the other elements