parent
f96ca01b1c
commit
d0d14dd0d0
@ -1,20 +0,0 @@
|
||||
Index: gstreamer/backend.cpp
|
||||
===================================================================
|
||||
--- gstreamer/backend.cpp (revision 862019)
|
||||
+++ gstreamer/backend.cpp (working copy)
|
||||
@@ -226,6 +227,15 @@
|
||||
}
|
||||
}
|
||||
g_list_free(factoryList);
|
||||
+ if (availableMimeTypes.contains("audio/x-vorbis")
|
||||
+ && availableMimeTypes.contains("application/x-ogm-audio")) {
|
||||
+ if (!availableMimeTypes.contains("audio/x-vorbis+ogg"))
|
||||
+ availableMimeTypes.append("audio/x-vorbis+ogg");
|
||||
+ if (!availableMimeTypes.contains("application/ogg")) /* *.ogg */
|
||||
+ availableMimeTypes.append("application/ogg");
|
||||
+ if (!availableMimeTypes.contains("audio/ogg")) /* *.oga */
|
||||
+ availableMimeTypes.append("audio/ogg");
|
||||
+ }
|
||||
availableMimeTypes.sort();
|
||||
return availableMimeTypes;
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
From 104872f266cf6675e27cc6e122300f4ed5baf3ab Mon Sep 17 00:00:00 2001
|
||||
From: Colin Guthrie <cguthrie@mandriva.org>
|
||||
Date: Wed, 13 Jan 2010 22:57:29 +0000
|
||||
Subject: [PATCH] gstreamer: Fix a problem where the fact a reset was needed was lost.
|
||||
|
||||
If you create the path (createPath()) *before* setting the media source,
|
||||
(setCurrentSource()) the gstreamer backend would forget the fact that a reset
|
||||
was needed and ultimately end up in an error state.
|
||||
|
||||
This change simply does not wipe out the m_resetNeeded flag when
|
||||
the source is set and leaves it as it is.
|
||||
|
||||
This fixes the test case application posted on
|
||||
https://qa.mandriva.com/show_bug.cgi?id=56807
|
||||
---
|
||||
gstreamer/mediaobject.cpp | 4 +++-
|
||||
1 files changed, 3 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/gstreamer/mediaobject.cpp b/gstreamer/mediaobject.cpp
|
||||
index 15eb080..40e4246 100644
|
||||
--- a/gstreamer/mediaobject.cpp
|
||||
+++ b/gstreamer/mediaobject.cpp
|
||||
@@ -916,7 +916,9 @@ void MediaObject::setSource(const MediaSource &source)
|
||||
// Go into to loading state
|
||||
changeState(Phonon::LoadingState);
|
||||
m_loading = true;
|
||||
- m_resetNeeded = false;
|
||||
+ // IMPORTANT: Honor the m_resetNeeded flag as it currently stands.
|
||||
+ // See https://qa.mandriva.com/show_bug.cgi?id=56807
|
||||
+ //m_resetNeeded = false;
|
||||
m_resumeState = false;
|
||||
m_pendingState = Phonon::StoppedState;
|
||||
|
||||
--
|
||||
1.6.6
|
||||
|
||||
commit 6fbea9b56a12281819a8c04afd5caa53cfeee39f
|
||||
Author: cguthrie <cguthrie@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>
|
||||
Date: Thu Jan 21 18:23:12 2010 +0000
|
||||
|
||||
gstreamer: Fix a problem encountered when playing, stopping and playing again.
|
||||
|
||||
As reported by Harald Fernengel, a similar problem to that fixed in r1076454
|
||||
also exists when you play->stop->play a media object.
|
||||
|
||||
This should fix the issue by marking a reset needed whenever we reach the stopped state.
|
||||
Thanks to Harald for finding the problem and pointing the way to the fix.
|
||||
|
||||
git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/kdesupport/phonon@1078188 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
|
||||
|
||||
diff --git a/gstreamer/mediaobject.cpp b/gstreamer/mediaobject.cpp
|
||||
index 509e749..d1707dd 100644
|
||||
--- a/gstreamer/mediaobject.cpp
|
||||
+++ b/gstreamer/mediaobject.cpp
|
||||
@@ -741,6 +741,8 @@ void MediaObject::changeState(State newstate)
|
||||
|
||||
case Phonon::StoppedState:
|
||||
m_backend->logMessage("phonon state changed: Stopped", Backend::Info, this);
|
||||
+ // We must reset the pipeline when playing again
|
||||
+ m_resetNeeded = true;
|
||||
m_tickTimer->stop();
|
||||
break;
|
||||
|
@ -1,78 +0,0 @@
|
||||
commit 7ab2d9572662f1afc776e5d90ecf35e212e3543c
|
||||
Author: cguthrie <cguthrie@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>
|
||||
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 <sys/ioctl.h>
|
||||
#include <iostream>
|
||||
#include <QSet>
|
||||
+#include <phonon/pulsesupport_p.h>
|
||||
#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<QByteArray, QVariant> 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) {
|
@ -1,186 +0,0 @@
|
||||
diff -up phonon-4.3.80/phonon/CMakeLists.txt.old_pa phonon-4.3.80/phonon/CMakeLists.txt
|
||||
--- phonon-4.3.80/phonon/CMakeLists.txt.old_pa 2009-12-03 13:29:35.000000000 -0600
|
||||
+++ phonon-4.3.80/phonon/CMakeLists.txt 2010-01-22 09:52:53.195187362 -0600
|
||||
@@ -8,15 +8,21 @@ endif (PHONON_BUILD_EXAMPLES)
|
||||
|
||||
add_subdirectory(experimental)
|
||||
|
||||
-set(PULSEAUDIO_MINIMUM_VERSION "0.9.21")
|
||||
+set(PULSEAUDIO_MINIMUM_VERSION "0.9.15")
|
||||
macro_optional_find_package(PulseAudio)
|
||||
+# PULSEAUDIO_DEVICE_MANAGER feature check could be moved to FindPulseAudio.cmake, hint hint. -- Rex
|
||||
+macro_ensure_version("0.9.21" "${PULSEAUDIO_VERSION}" PULSEAUDIO_DEVICE_MANAGER)
|
||||
macro_log_feature(PULSEAUDIO_FOUND "PulseAudio" "A cross-platform, networked sound server." "http://www.pulseaudio.org" FALSE "" "Allows audio playback via the PulseAudio soundserver when it is running")
|
||||
macro_optional_find_package(GLIB2)
|
||||
macro_log_feature(GLIB2_FOUND "GLib2" "GLib 2 is required to compile the pulseaudio for Phonon" "http://www.gtk.org/download/" FALSE)
|
||||
|
||||
+
|
||||
if (GLIB2_FOUND AND PULSEAUDIO_FOUND)
|
||||
add_definitions(-DHAVE_PULSEAUDIO)
|
||||
include_directories(${GLIB2_INCLUDE_DIR} ${PULSEAUDIO_INCLUDE_DIR})
|
||||
+ if (PULSEAUDIO_DEVICE_MANAGER)
|
||||
+ add_definitions(-DHAVE_PULSEAUDIO_DEVICE_MANAGER)
|
||||
+ endif(PULSEAUDIO_DEVICE_MANAGER)
|
||||
else(GLIB2_FOUND AND PULSEAUDIO_FOUND)
|
||||
set(PULSEAUDIO_INCLUDE_DIR "")
|
||||
set(PULSEAUDIO_LIBRARY "")
|
||||
diff -up phonon-4.3.80/phonon/pulsesupport.cpp.old_pa phonon-4.3.80/phonon/pulsesupport.cpp
|
||||
--- phonon-4.3.80/phonon/pulsesupport.cpp.old_pa 2009-12-03 13:29:35.000000000 -0600
|
||||
+++ phonon-4.3.80/phonon/pulsesupport.cpp 2010-01-22 09:48:15.699935986 -0600
|
||||
@@ -30,7 +30,9 @@
|
||||
#include <pulse/pulseaudio.h>
|
||||
#include <pulse/xmalloc.h>
|
||||
#include <pulse/glib-mainloop.h>
|
||||
-#include <pulse/ext-device-manager.h>
|
||||
+#ifdef HAVE_PULSEAUDIO_DEVICE_MANAGER
|
||||
+# include <pulse/ext-device-manager.h>
|
||||
+#endif
|
||||
#endif // HAVE_PULSEAUDIO
|
||||
|
||||
#include "pulsesupport_p.h"
|
||||
@@ -151,7 +153,34 @@ static QMap<Phonon::Category, QMap<int,
|
||||
static QMap<QString, uint32_t> s_captureStreamIndexMap;
|
||||
static QMap<QString, int> s_captureStreamMoveQueue;
|
||||
|
||||
+static void fakeSingleOutputDevice()
|
||||
+{
|
||||
+ // OK so we don't have the device manager extension, but we can show a single device and fake it.
|
||||
+ int index;
|
||||
+ s_outputDeviceIndexes.clear();
|
||||
+ s_outputDevices.clear();
|
||||
+ s_outputDevicePriorities.clear();
|
||||
+ index = s_deviceIndexCounter++;
|
||||
+ s_outputDeviceIndexes.insert("sink:default", index);
|
||||
+ s_outputDevices.insert(index, AudioDevice("sink:default", QObject::tr("PulseAudio Sound Server").toUtf8(), "audio-backend-pulseaudio", 0));
|
||||
+ for (int i = Phonon::NoCategory; i <= Phonon::LastCategory; ++i) {
|
||||
+ Phonon::Category cat = static_cast<Phonon::Category>(i);
|
||||
+ s_outputDevicePriorities[cat].insert(0, index);
|
||||
+ }
|
||||
+
|
||||
+ s_captureDeviceIndexes.clear();
|
||||
+ s_captureDevices.clear();
|
||||
+ s_captureDevicePriorities.clear();
|
||||
+ index = s_deviceIndexCounter++;
|
||||
+ s_captureDeviceIndexes.insert("source:default", index);
|
||||
+ s_captureDevices.insert(index, AudioDevice("source:default", QObject::tr("PulseAudio Sound Server").toUtf8(), "audio-backend-pulseaudio", 0));
|
||||
+ for (int i = Phonon::NoCategory; i <= Phonon::LastCategory; ++i) {
|
||||
+ Phonon::Category cat = static_cast<Phonon::Category>(i);
|
||||
+ s_captureDevicePriorities[cat].insert(0, index);
|
||||
+ }
|
||||
+}
|
||||
|
||||
+#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);
|
||||
@@ -171,30 +200,7 @@ static void ext_device_manager_read_cb(p
|
||||
|
||||
if (eol < 0) {
|
||||
logMessage(QString("Failed to initialize device manager extension: %1").arg(pa_strerror(pa_context_errno(c))));
|
||||
- // OK so we don't have the device manager extension, but we can show a single device and fake it.
|
||||
- int index;
|
||||
- s_outputDeviceIndexes.clear();
|
||||
- s_outputDevices.clear();
|
||||
- s_outputDevicePriorities.clear();
|
||||
- index = s_deviceIndexCounter++;
|
||||
- s_outputDeviceIndexes.insert("sink:default", index);
|
||||
- s_outputDevices.insert(index, AudioDevice("sink:default", QObject::tr("PulseAudio Sound Server").toUtf8(), "audio-backend-pulseaudio", 0));
|
||||
- for (int i = Phonon::NoCategory; i <= Phonon::LastCategory; ++i) {
|
||||
- Phonon::Category cat = static_cast<Phonon::Category>(i);
|
||||
- s_outputDevicePriorities[cat].insert(0, index);
|
||||
- }
|
||||
-
|
||||
- s_captureDeviceIndexes.clear();
|
||||
- s_captureDevices.clear();
|
||||
- s_captureDevicePriorities.clear();
|
||||
- index = s_deviceIndexCounter++;
|
||||
- s_captureDeviceIndexes.insert("source:default", index);
|
||||
- s_captureDevices.insert(index, AudioDevice("source:default", QObject::tr("PulseAudio Sound Server").toUtf8(), "audio-backend-pulseaudio", 0));
|
||||
- for (int i = Phonon::NoCategory; i <= Phonon::LastCategory; ++i) {
|
||||
- Phonon::Category cat = static_cast<Phonon::Category>(i);
|
||||
- s_captureDevicePriorities[cat].insert(0, index);
|
||||
- }
|
||||
-
|
||||
+ fakeSingleOutputDevice();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -369,6 +375,7 @@ static void ext_device_manager_read_cb(p
|
||||
}
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
static void set_output_device(QString streamUuid)
|
||||
{
|
||||
@@ -550,12 +557,12 @@ static void subscribe_cb(pa_context *c,
|
||||
}
|
||||
}
|
||||
|
||||
-
|
||||
static void ext_device_manager_subscribe_cb(pa_context *c, void *) {
|
||||
Q_ASSERT(c);
|
||||
|
||||
pa_operation *o;
|
||||
PulseUserData *u = new PulseUserData; /** @todo Make some object to receive the info... */
|
||||
+#ifdef HAVE_PULSEAUDIO_DEVICE_MANAGER
|
||||
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) {
|
||||
@@ -566,6 +573,7 @@ static void ext_device_manager_subscribe
|
||||
return;
|
||||
}
|
||||
pa_operation_unref(o);
|
||||
+#endif
|
||||
|
||||
|
||||
// Register for the stream changes...
|
||||
@@ -584,6 +592,7 @@ static void context_state_callback(pa_co
|
||||
{
|
||||
Q_ASSERT(c);
|
||||
|
||||
+ logMessage(QString("context_state_callback %1").arg(pa_context_get_state(c)));
|
||||
switch (pa_context_get_state(c)) {
|
||||
case PA_CONTEXT_UNCONNECTED:
|
||||
case PA_CONTEXT_CONNECTING:
|
||||
@@ -592,8 +601,18 @@ static void context_state_callback(pa_co
|
||||
break;
|
||||
|
||||
case PA_CONTEXT_READY:
|
||||
+#ifdef HAVE_PULSEAUDIO_DEVICE_MANAGER
|
||||
// Attempt to load things up
|
||||
ext_device_manager_subscribe_cb(c, NULL);
|
||||
+#else
|
||||
+ s_pulseActive = true;
|
||||
+ if (s_connectionEventloop) {
|
||||
+ s_connectionEventloop->exit(0);
|
||||
+ s_connectionEventloop = 0;
|
||||
+ }
|
||||
+ fakeSingleOutputDevice();
|
||||
+ ext_device_manager_subscribe_cb(c, NULL);
|
||||
+#endif
|
||||
break;
|
||||
|
||||
case PA_CONTEXT_FAILED:
|
||||
@@ -665,6 +684,7 @@ PulseSupport::PulseSupport()
|
||||
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 eventloop...");
|
||||
s_connectionEventloop->exec();
|
||||
}
|
||||
#endif
|
||||
@@ -821,11 +841,13 @@ static void setDevicePriority(Category c
|
||||
}
|
||||
devices[list.size()] = NULL;
|
||||
|
||||
+#ifdef HAVE_PULSEAUDIO_DEVICE_MANAGER
|
||||
pa_operation *o;
|
||||
if (!(o = pa_ext_device_manager_reorder_devices_for_role(s_context, role.toUtf8().constData(), (const char**)devices, NULL, NULL)))
|
||||
logMessage(QString("pa_ext_device_manager_reorder_devices_for_role() failed"));
|
||||
else
|
||||
pa_operation_unref(o);
|
||||
+#endif
|
||||
|
||||
for (i = 0; i < list.size(); ++i)
|
||||
pa_xfree(devices[i]);
|
Loading…
Reference in new issue