From f96ca01b1c606558ad6a1709eb05310769be783b Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Fri, 22 Jan 2010 17:10:22 +0000 Subject: [PATCH] phonon-4.3.80-fix-xine-pulseaudio-init.patch replaces phonon-4.3.80-kde223662.patch more nicely formatted and commented Fri Jan 22 2010 Rex Dieter - 4.3.80-6 - sync w/mdv patches --- phonon-4.3.80-fix-xine-pulseaudio-init.patch | 78 ++++++++++++++++++++ phonon-4.3.80-kde223662.patch | 51 ------------- phonon.spec | 14 ++-- 3 files changed, 87 insertions(+), 56 deletions(-) create mode 100644 phonon-4.3.80-fix-xine-pulseaudio-init.patch delete mode 100644 phonon-4.3.80-kde223662.patch diff --git a/phonon-4.3.80-fix-xine-pulseaudio-init.patch b/phonon-4.3.80-fix-xine-pulseaudio-init.patch new file mode 100644 index 0000000..f297abe --- /dev/null +++ b/phonon-4.3.80-fix-xine-pulseaudio-init.patch @@ -0,0 +1,78 @@ +commit 7ab2d9572662f1afc776e5d90ecf35e212e3543c +Author: cguthrie +Date: Thu Jan 21 20:13:50 2010 +0000 + + xine: Always ensure we create the correct xine port for audio output. + + When integrating with pulseaudio it was possible that the port was not correctly created. + This could happen if phonon was started and the first device detected from PA was a capture device + rather than a playback device (which is unlikely) or if the first device detected + was a removable audio device which was subsequently removed before playback started. + + There are possibly other cases where this could happen too. + In this case xine would create a null port. + + This change reverts a previous 'fix' committed in r1051721. I now issue a special case + for dealing with PA support in the createPort() method. As a result I no longer need + to special case handle the audioDriverFor() method of the backend so this is + now removed. + + CCBUG: 223662 + + git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/kdesupport/phonon@1078226 283d02a7-25f6-0310-bc7c-ecb5cbfe19da + +diff --git a/xine/audiooutput.cpp b/xine/audiooutput.cpp +index c6ca730..1444aa3 100644 +--- a/xine/audiooutput.cpp ++++ b/xine/audiooutput.cpp +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include "mediaobject.h" + #include "backend.h" + #include "events.h" +@@ -48,10 +49,6 @@ namespace Xine + AudioOutput::AudioOutput(QObject *parent) + : AbstractAudioOutput(new AudioOutputXT, parent) + { +- // Always initialise the "device" in use. +- // This is needed for PulseAudio support as subsequent calls to setOutputDevice() +- // are suppressed +- setOutputDevice(0); + } + + AudioOutput::~AudioOutput() +@@ -132,6 +129,17 @@ xine_audio_port_t *AudioOutput::createPort(const AudioOutputDevice &deviceDesc) + { + K_XT(AudioOutput); + xine_audio_port_t *port = 0; ++ ++ PulseSupport *pulse = PulseSupport::getInstance(); ++ if (pulse->isActive()) { ++ // Here we trust that the PA plugin is setup correctly and we just want to use it. ++ const QByteArray &outputPlugin = "pulseaudio"; ++ debug() << Q_FUNC_INFO << "PA Active: use output plugin:" << outputPlugin; ++ port = xine_open_audio_driver(xt->m_xine, outputPlugin.constData(), 0); ++ debug() << Q_FUNC_INFO << "----------------------------------------------- audio_port created"; ++ return port; ++ } ++ + if (!deviceDesc.isValid()) { + // use null output for invalid devices + port = xine_open_audio_driver(xt->m_xine, "none", 0); +diff --git a/xine/backend.cpp b/xine/backend.cpp +index 7e881da..9010b8c 100644 +--- a/xine/backend.cpp ++++ b/xine/backend.cpp +@@ -588,9 +588,6 @@ QHash Backend::audioOutputProperties(int audioDevice) + + QByteArray Backend::audioDriverFor(int audioDevice) + { +- if (PulseSupport::getInstance()->isActive()) +- return "pulseaudio"; +- + instance()->checkAudioOutputs(); + const Backend *const that = instance(); + for (int i = 0; i < that->m_audioOutputInfos.size(); ++i) { diff --git a/phonon-4.3.80-kde223662.patch b/phonon-4.3.80-kde223662.patch deleted file mode 100644 index 2eacfcf..0000000 --- a/phonon-4.3.80-kde223662.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- trunk/kdesupport/phonon/xine/audiooutput.cpp 2009/12/27 16:57:19 1066664 -+++ trunk/kdesupport/phonon/xine/audiooutput.cpp 2010/01/21 20:13:50 1078226 -@@ -26,6 +26,7 @@ - #include - #include - #include -+#include - #include "mediaobject.h" - #include "backend.h" - #include "events.h" -@@ -48,10 +49,6 @@ - AudioOutput::AudioOutput(QObject *parent) - : AbstractAudioOutput(new AudioOutputXT, parent) - { -- // Always initialise the "device" in use. -- // This is needed for PulseAudio support as subsequent calls to setOutputDevice() -- // are suppressed -- setOutputDevice(0); - } - - AudioOutput::~AudioOutput() -@@ -132,6 +129,17 @@ - { - K_XT(AudioOutput); - xine_audio_port_t *port = 0; -+ -+ PulseSupport *pulse = PulseSupport::getInstance(); -+ if (pulse->isActive()) { -+ // Here we trust that the PA plugin is setup correctly and we just want to use it. -+ const QByteArray &outputPlugin = "pulseaudio"; -+ debug() << Q_FUNC_INFO << "PA Active: use output plugin:" << outputPlugin; -+ port = xine_open_audio_driver(xt->m_xine, outputPlugin.constData(), 0); -+ debug() << Q_FUNC_INFO << "----------------------------------------------- audio_port created"; -+ return port; -+ } -+ - if (!deviceDesc.isValid()) { - // use null output for invalid devices - port = xine_open_audio_driver(xt->m_xine, "none", 0); ---- trunk/kdesupport/phonon/xine/backend.cpp 2009/12/27 16:57:19 1066664 -+++ trunk/kdesupport/phonon/xine/backend.cpp 2010/01/21 20:13:50 1078226 -@@ -588,9 +588,6 @@ - - QByteArray Backend::audioDriverFor(int audioDevice) - { -- if (PulseSupport::getInstance()->isActive()) -- return "pulseaudio"; -- - instance()->checkAudioOutputs(); - const Backend *const that = instance(); - for (int i = 0; i < that->m_audioOutputInfos.size(); ++i) { diff --git a/phonon.spec b/phonon.spec index 13ae586..1d864e6 100644 --- a/phonon.spec +++ b/phonon.spec @@ -4,7 +4,7 @@ Summary: Multimedia framework api Name: phonon Version: 4.3.80 -Release: 5%{?dist}.2 +Release: 6%{?dist} Group: System Environment/Libraries License: LGPLv2+ URL: http://phonon.kde.org/ @@ -33,14 +33,14 @@ Patch51: phonon-4.3.50-fix-decodebin-usage.patch Patch52: phonon-4.3.50-gstreamer-fix-seekable-query-failed.patch Patch53: phonon-4.3.50-phonon-allow-stop-empty-source.patch Patch54: phonon-4.3.80-fix-gstreamer-pulseaudio-deadlock.patch +# http://bugs.kde.org/223662 +Patch55: phonon-4.3.80-fix-xine-pulseaudio-init.patch # patch adapted from http://permalink.gmane.org/gmane.comp.kde.users.multimedia/5700 # splits out device_manager bits used only on pa >= 0.9.21 Patch60: phonon-4.3.80-old_pa.patch ## Upstream patches -# http://bugs.kde.org/223662 -Patch100: phonon-4.3.80-kde223662.patch BuildRequires: automoc4 >= 0.9.86 BuildRequires: cmake >= 2.6.0 @@ -108,9 +108,10 @@ Provides: %{name}-backend-gst = %{version}-%{release} %patch51 -p0 -b .fix-decodebin-usage %patch52 -p1 -b .gstreamer-fix-seekable-query-failed %patch53 -p1 -b .phonon-allow-stop-empty-source -%patch54 -p1 -b .gstreamer-pulseaudio-deadlock +%patch54 -p1 -b .fix-gstreamer-pulseaudio-deadlock +%patch55 -p1 -b .fix-xine-pulseaudio-init + %patch60 -p1 -b .old_pa -%patch100 -p3 -b .kde223662 %build @@ -215,6 +216,9 @@ gtk-update-icon-cache %{_kde4_iconsdir}/hicolor &> /dev/null ||: %changelog +* Fri Jan 22 2010 Rex Dieter - 4.3.80-6 +- sync w/mdv patches + * Fri Jan 22 2010 Rex Dieter - 4.3.80-5.2 - F11: patch/modularize pa device-manager bits