summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin McPherson <justin.mcpherson@nokia.com>2009-11-11 03:53:32 (GMT)
committerJustin McPherson <justin.mcpherson@nokia.com>2009-11-11 03:53:32 (GMT)
commit7719e7fb7cc0724ac0792b8c122c7c20b379bc05 (patch)
tree00c1742cc0a6dd5be9d557a7de2f51ba5179037c
parent8811a447ceae6fcc42cb120a3b355decf250a229 (diff)
downloadQt-7719e7fb7cc0724ac0792b8c122c7c20b379bc05.zip
Qt-7719e7fb7cc0724ac0792b8c122c7c20b379bc05.tar.gz
Qt-7719e7fb7cc0724ac0792b8c122c7c20b379bc05.tar.bz2
gstreamer: Set the glib app name only once and do it in the backend.
Integrated KDE change 1027567 by cguthrie. Glib issues a warning if this is called more than once so we ensure that's what we do. Reviewed-by: Dmytro Poplavskiy
-rw-r--r--src/3rdparty/phonon/gstreamer/audiooutput.cpp1
-rw-r--r--src/3rdparty/phonon/gstreamer/backend.cpp7
2 files changed, 7 insertions, 1 deletions
diff --git a/src/3rdparty/phonon/gstreamer/audiooutput.cpp b/src/3rdparty/phonon/gstreamer/audiooutput.cpp
index 138a7e4..fcadac2 100644
--- a/src/3rdparty/phonon/gstreamer/audiooutput.cpp
+++ b/src/3rdparty/phonon/gstreamer/audiooutput.cpp
@@ -42,7 +42,6 @@ AudioOutput::AudioOutput(Backend *backend, QObject *parent)
static int count = 0;
m_name = "AudioOutput" + QString::number(count++);
if (m_backend->isValid()) {
- g_set_application_name(qApp->applicationName().toUtf8());
m_audioBin = gst_bin_new (NULL);
gst_object_ref (GST_OBJECT (m_audioBin));
gst_object_sink (GST_OBJECT (m_audioBin));
diff --git a/src/3rdparty/phonon/gstreamer/backend.cpp b/src/3rdparty/phonon/gstreamer/backend.cpp
index 4041f2b..7a06378 100644
--- a/src/3rdparty/phonon/gstreamer/backend.cpp
+++ b/src/3rdparty/phonon/gstreamer/backend.cpp
@@ -49,6 +49,13 @@ Backend::Backend(QObject *parent, const QVariantList &)
, m_debugLevel(Warning)
, m_isValid(false)
{
+ // In order to support reloading, we only set the app name once...
+ static bool first = true;
+ if (first) {
+ first = false;
+ g_set_application_name(qApp->applicationName().toUtf8());
+ }
+
GError *err = 0;
bool wasInit = gst_init_check(0, 0, &err); //init gstreamer: must be called before any gst-related functions
if (err)