commit phonon for openSUSE:Factory
Hello community, here is the log from the commit of package phonon for openSUSE:Factory checked in at Wed Mar 31 19:39:04 CEST 2010. -------- --- KDE/phonon/phonon.changes 2010-02-01 13:24:45.000000000 +0100 +++ /mounts/work_src_done/STABLE/phonon/phonon.changes 2010-03-26 16:14:26.000000000 +0100 @@ -1,0 +2,18 @@ +Fri Mar 26 15:13:31 UTC 2010 - tittiatcoke@gmail.com + +- Added a patch (upstream/Colin Cuthrie) to prevent an endless loop + when pulseaudio is not installed + +------------------------------------------------------------------- +Wed Mar 24 07:07:21 UTC 2010 - per@osbeck.com + +- add BuildRequires for proper pulseaudio support + +------------------------------------------------------------------- +Mon Mar 15 11:17:22 CET 2010 - dmueller@suse.de + +- update to 4.4.0: + * bugfixes + * improved video recording/playback + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- phonon-4.2.0-ogg-mime-type.patch phonon-4.3.80.tar.bz2 New: ---- phonon-4.4.0-pulse-connection-rejig.patch phonon-4.4.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ phonon-backend-xine.spec ++++++ --- /var/tmp/diff_new_pack.vRvqiX/_old 2010-03-31 19:38:27.000000000 +0200 +++ /var/tmp/diff_new_pack.vRvqiX/_new 2010-03-31 19:38:27.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package phonon-backend-xine (Version 4.3.80) +# spec file for package phonon-backend-xine (Version 4.4.0) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -26,15 +26,16 @@ %endif BuildRequires: gstreamer-0_10-plugins-base-devel BuildRequires: fdupes -Version: 4.3.80 -Release: 2 +Version: 4.4.0 +Release: 1 License: LGPLv2.0+ Url: http://phonon.kde.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-build Group: Development/Libraries/KDE Summary: Phonon Multimedia Platform Abstraction Source0: phonon-%{version}.tar.bz2 -Patch1: phonon-4.2.0-ogg-mime-type.patch +# Prevent that phonon gets in an endless loop if pulseaudio is not installed +Patch1: phonon-4.4.0-pulse-connection-rejig.patch %if %suse_version > 1030 %requires_ge libqt4 %endif @@ -78,8 +79,8 @@ %endif %prep -%setup -q -n phonon-%{version} -%patch1 +%setup -q -n phonon-4.4 +%patch1 -p1 %build # compile everything for now, actually we should compile ++++++ phonon.spec ++++++ --- /var/tmp/diff_new_pack.vRvqiX/_old 2010-03-31 19:38:27.000000000 +0200 +++ /var/tmp/diff_new_pack.vRvqiX/_new 2010-03-31 19:38:27.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package phonon (Version 4.3.80) +# spec file for package phonon (Version 4.4.0) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -18,10 +18,10 @@ Name: phonon -BuildRequires: automoc4 cmake kde4-filesystem libqt4-devel +BuildRequires: automoc4 cmake kde4-filesystem libpulse-devel libqt4-devel BuildRequires: fdupes -Version: 4.3.80 -Release: 2 +Version: 4.4.0 +Release: 1 License: LGPLv2.0+ Url: http://phonon.kde.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -29,6 +29,8 @@ Summary: Phonon Multimedia Platform Abstraction Source0: %name-%{version}.tar.bz2 Source1: baselibs.conf +# Patch to prevent phonon getting in an endless loop when pulseaudio is not installed +Patch1: phonon-4.4.0-pulse-connection-rejig.patch %if %suse_version > 1030 %requires_ge libqt4 %endif @@ -82,7 +84,8 @@ %prep -%setup -q +%setup -q -n %name-4.4 +%patch1 -p1 %build %cmake_kde4 -d build ++++++ phonon-4.4.0-pulse-connection-rejig.patch ++++++
From b844a4cc7c0e527048083a19adca3a82b4003eb7 Mon Sep 17 00:00:00 2001 From: Colin Guthrie <cguthrie@mandriva.org> Date: Wed, 17 Mar 2010 19:42:47 +0000 Subject: [PATCH] pulse: Rework the connection probing logic.
Completely rework the connection to PA to avoid the use of a QEventLoop. It starts off by trying to connect via a pa_mainloop and in a blocking fashion. If that fails, then we simply carry on as if PA doesn't exist. If it succeeds, it reads in all the information about sinks/sources and then disconnects before reconnecting via the nicely integrated glib main loop. By avoiding the use of a QEventLoop, it fixes strange problems in some applications such as okular as reported via: https://bugs.kde.org/show_bug.cgi?id=228324 --- phonon/pulsesupport.cpp | 237 +++++++++++++++++++++++++++------------------- 1 files changed, 139 insertions(+), 98 deletions(-) diff --git a/phonon/pulsesupport.cpp b/phonon/pulsesupport.cpp index e12c44f..642843f 100644 diff -pru phonon-4.4/phonon/pulsesupport.cpp phonon-mine/phonon/pulsesupport.cpp --- phonon-4.4/phonon/pulsesupport.cpp 2010-02-23 16:38:04.000000000 +0100 +++ phonon-mine/phonon/pulsesupport.cpp 2010-03-24 23:52:26.860990424 +0100 @@ -135,7 +135,6 @@ static bool s_pulseActive = false; static pa_glib_mainloop *s_mainloop = NULL; static pa_context *s_context = NULL; -static QEventLoop *s_connectionEventloop = NULL; @@ -181,31 +180,25 @@ static void createGenericDevices() } #ifdef HAVE_PULSEAUDIO_DEVICE_MANAGER -static void ext_device_manager_subscribe_cb(pa_context *, void *); static void ext_device_manager_read_cb(pa_context *c, const pa_ext_device_manager_info *info, int eol, void *userdata) { Q_ASSERT(c); Q_ASSERT(userdata); - // If this is our first iteration, set things up properly - if (s_connectionEventloop) { - logMessage("Exiting connection event loop (PulseAudio server found)"); - s_connectionEventloop->exit(0); - s_connectionEventloop = NULL; - s_pulseActive = true; - - pa_operation *o; - pa_ext_device_manager_set_subscribe_cb(c, ext_device_manager_subscribe_cb, NULL); - if ((o = pa_ext_device_manager_subscribe(c, 1, NULL, NULL))) - pa_operation_unref(o); - } + PulseUserData *u = reinterpret_cast<PulseUserData*>(userdata); if (eol < 0) { logMessage(QString("Failed to initialize device manager extension: %1").arg(pa_strerror(pa_context_errno(c)))); + logMessage("Falling back to single device mode"); createGenericDevices(); + delete u; + + // If this is our probe phase, exit now + if (s_context != c) + pa_context_disconnect(c); + return; } - PulseUserData *u = reinterpret_cast<PulseUserData*>(userdata); if (eol) { // We're done reading the data, so order it by priority and copy it into the // static variables where it can then be accessed by those classes that need it. @@ -291,6 +284,8 @@ static void ext_device_manager_read_cb(p } if (s_instance) { + // This wont be emitted durring the connection probe phase + // which is intensional if (output_changed) s_instance->emitObjectDescriptionChanged(AudioOutputDeviceType); if (capture_changed) @@ -325,6 +320,11 @@ static void ext_device_manager_read_cb(p } } } + + // If this is our probe phase, exit now as we're finished reading + // our device info and can exit and reconnect + if (s_context != c) + pa_context_disconnect(c); } if (!info) @@ -376,6 +376,19 @@ static void ext_device_manager_read_cb(p } } } + +static void ext_device_manager_subscribe_cb(pa_context *c, void *) { + Q_ASSERT(c); + + pa_operation *o; + PulseUserData *u = new PulseUserData; + if (!(o = pa_ext_device_manager_read(c, ext_device_manager_read_cb, u))) { + logMessage(QString("pa_ext_device_manager_read() failed.")); + delete u; + return; + } + pa_operation_unref(o); +} #endif static void set_output_device(QString streamUuid) @@ -559,49 +572,6 @@ static void subscribe_cb(pa_context *c, } -static void ext_device_manager_subscribe_cb(pa_context *c, void *) { - Q_ASSERT(c); - - pa_operation *o; -#ifdef HAVE_PULSEAUDIO_DEVICE_MANAGER - PulseUserData *u = new PulseUserData; /** @todo Make some object to receive the info... */ - if (!(o = pa_ext_device_manager_read(c, ext_device_manager_read_cb, u))) { - // We need to deal with failure on first iteration - if (s_connectionEventloop) { - logMessage("Entering connection eventloop (initialisation failed)"); - s_connectionEventloop->exit(0); - s_connectionEventloop = NULL; - } - logMessage(QString("pa_ext_device_manager_read() failed")); - return; - } - pa_operation_unref(o); -#else - // If we do not have Device Manager support. We just bail out now - // and say we are active with our single "devices" for playback and capture - s_pulseActive = true; - logMessage("Entering connection eventloop (successfully detected PulseAudio)"); - if (s_connectionEventloop) { - s_connectionEventloop->exit(0); - s_connectionEventloop = NULL; - } - createGenericDevices(); -#endif - - - // Register for the stream changes... - pa_context_set_subscribe_callback(c, subscribe_cb, NULL); - - if (!(o = pa_context_subscribe(c, (pa_subscription_mask_t) - (PA_SUBSCRIPTION_MASK_SINK_INPUT| - PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT), NULL, NULL))) { - logMessage(QString("pa_context_subscribe() failed")); - return; - } - pa_operation_unref(o); -} - - static const char* statename(pa_context_state_t state) { switch (state) @@ -625,32 +595,68 @@ static void context_state_callback(pa_co Q_ASSERT(c); logMessage(QString("context_state_callback %1").arg(statename(pa_context_get_state(c)))); - switch (pa_context_get_state(c)) { - case PA_CONTEXT_UNCONNECTED: - case PA_CONTEXT_CONNECTING: - case PA_CONTEXT_AUTHORIZING: - case PA_CONTEXT_SETTING_NAME: - break; + pa_context_state_t state = pa_context_get_state(c); + if (state == PA_CONTEXT_READY) { + // We've connected to PA, so it is active + s_pulseActive = true; - case PA_CONTEXT_READY: - // Attempt to load things up - ext_device_manager_subscribe_cb(c, NULL); - break; + // Attempt to load things up + pa_operation *o; - case PA_CONTEXT_FAILED: - s_pulseActive = false; - if (s_connectionEventloop) { - logMessage("Entering connection eventloop (connection failed)"); - s_connectionEventloop->exit(0); - s_connectionEventloop = NULL; + // 1. Register for the stream changes (except during probe) + if (s_context == c) { + pa_context_set_subscribe_callback(c, subscribe_cb, NULL); + + if (!(o = pa_context_subscribe(c, (pa_subscription_mask_t) + (PA_SUBSCRIPTION_MASK_SINK_INPUT| + PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT), NULL, NULL))) { + logMessage(QString("pa_context_subscribe() failed")); + return; } - break; + pa_operation_unref(o); + } - case PA_CONTEXT_TERMINATED: - default: - s_pulseActive = false; - /// @todo Deal with reconnection... - break; +#ifdef HAVE_PULSEAUDIO_DEVICE_MANAGER + // 2a. Attempt to initialise Device Manager info (except during probe) + if (s_context == c) { + pa_ext_device_manager_set_subscribe_cb(c, ext_device_manager_subscribe_cb, NULL); + if (!(o = pa_ext_device_manager_subscribe(c, 1, NULL, NULL))) { + logMessage(QString("pa_ext_device_manager_subscribe() failed")); + return; + } + pa_operation_unref(o); + } + + // 3. Attempt to read info from Device Manager + PulseUserData *u = new PulseUserData; + if (!(o = pa_ext_device_manager_read(c, ext_device_manager_read_cb, u))) { + logMessage(QString("pa_ext_device_manager_read() failed. Attempting to continue without device manager support")); + createGenericDevices(); + delete u; + + // If this is our probe phase, exit immediately + if (s_context != c) + pa_context_disconnect(c); + + return; + } + pa_operation_unref(o); + +#else + // If we know do not have Device Manager support, we just create our dummy devices now + createGenericDevices(); + + // If this is our probe phase, exit immediately + if (s_context != c) + pa_context_disconnect(c); +#endif + } else if (!PA_CONTEXT_IS_GOOD(state)) { + /// @todo Deal with reconnection... + //logMessage("Connection to PulseAudio lost"); + + // If this is our probe phase, exit our context immediately + if (s_context != c) + pa_context_disconnect(c); } } #endif // HAVE_PULSEAUDIO @@ -689,27 +695,67 @@ PulseSupport::PulseSupport() // To allow for easy debugging, give an easy way to disable this pulseaudio check QString pulseenv = qgetenv("PHONON_PULSEAUDIO_DISABLE"); - if (pulseenv.toInt()) + if (pulseenv.toInt()) { + logMessage("PulseAudio support disabled: PHONON_PULSEAUDIO_DISABLE is set"); + return; + } + + // First of all conenct to PA via simple/blocking means and if that succeeds, + // use a fully async integrated mainloop method to connect and get proper support. + pa_mainloop *p_test_mainloop; + if (!(p_test_mainloop = pa_mainloop_new())) { + logMessage("PulseAudio support disabled: Unable to create mainloop"); + return; + } + + pa_context *p_test_context; + if (!(p_test_context = pa_context_new(pa_mainloop_get_api(p_test_mainloop), "libphonon-probe"))) { + logMessage("PulseAudio support disabled: Unable to create context"); + pa_mainloop_free(p_test_mainloop); + return; + } + + logMessage("Probing for PulseAudio..."); + // (cg) Convert to PA_CONTEXT_NOFLAGS when PulseAudio 0.9.19 is required + if (pa_context_connect(p_test_context, NULL, static_cast<pa_context_flags_t>(0), NULL) < 0) { + logMessage(QString("PulseAudio support disabled: %1").arg(pa_strerror(pa_context_errno(p_test_context)))); + pa_context_disconnect(p_test_context); + pa_context_unref(p_test_context); + pa_mainloop_free(p_test_mainloop); + return; + } + + pa_context_set_state_callback(p_test_context, &context_state_callback, NULL); + for (;;) { + pa_mainloop_iterate(p_test_mainloop, 1, NULL); + + if (!PA_CONTEXT_IS_GOOD(pa_context_get_state(p_test_context))) { + logMessage("PulseAudio probe complete."); + break; + } + } + pa_context_disconnect(p_test_context); + pa_context_unref(p_test_context); + pa_mainloop_free(p_test_mainloop); + + if (!s_pulseActive) { + logMessage("PulseAudio support is not available."); return; + } + // If we're still here, PA is available. + logMessage("PulseAudio support enabled"); + + // Now we connect for real using a proper main loop that we can forget + // all about processing. s_mainloop = pa_glib_mainloop_new(NULL); Q_ASSERT(s_mainloop); pa_mainloop_api *api = pa_glib_mainloop_get_api(s_mainloop); - // We create a simple event loop to allow the glib loop - // to iterate until we've connected or not to the server. - s_connectionEventloop = new QEventLoop; - - // XXX I don't want to show up in the client list. All I want to know is the list of sources - // and sinks... s_context = pa_context_new(api, "libphonon"); // (cg) Convert to PA_CONTEXT_NOFLAGS when PulseAudio 0.9.19 is required - if (pa_context_connect(s_context, NULL, static_cast<pa_context_flags_t>(0), 0) >= 0) { - pa_context_set_state_callback(s_context, &context_state_callback, s_connectionEventloop); - // Now we block until we connect or otherwise... - logMessage("Entering connection eventloop..."); - s_connectionEventloop->exec(); - } + if (pa_context_connect(s_context, NULL, static_cast<pa_context_flags_t>(0), 0) >= 0) + pa_context_set_state_callback(s_context, &context_state_callback, NULL); #endif } @@ -725,11 +771,6 @@ PulseSupport::~PulseSupport() pa_glib_mainloop_free(s_mainloop); s_mainloop = NULL; } - - if (s_connectionEventloop) { - delete s_connectionEventloop; - s_connectionEventloop = NULL; - } #endif } Endast i phonon-mine/phonon: pulsesupport.cpp.orig ++++++ phonon-4.3.80.tar.bz2 -> phonon-4.4.0.tar.bz2 ++++++ ++++ 2667 lines of diff (skipped) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de