QSoundEffect: Don't try guess a media role if one has not been provided.
authorRobin Burchell <robin.burchell@jollamobile.com>
Thu, 16 Jan 2014 14:28:02 +0000 (15:28 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 7 Feb 2014 12:23:16 +0000 (13:23 +0100)
Trying to heuristically guess this kind of thing is almost always a bad idea.
Expect the creator of the output to explicitly tell us the category instead
of guessing.

Change-Id: I5f2988e2456685f3622e0ab136951b1742215f71
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
src/multimedia/audio/qsoundeffect_pulse_p.cpp

index 23e8d72..ef09cd9 100644 (file)
@@ -928,12 +928,8 @@ void QSoundEffectPrivate::createPulseStream()
         return;
 
     pa_proplist *propList = pa_proplist_new();
-    if (m_category.isNull()) {
-        // Meant to be one of the strings "video", "music", "game", "event", "phone", "animation", "production", "a11y", "test"
-        pa_proplist_sets(propList, PA_PROP_MEDIA_ROLE, "game");
-    } else {
+    if (!m_category.isNull())
         pa_proplist_sets(propList, PA_PROP_MEDIA_ROLE, m_category.toLatin1().constData());
-    }
     pa_stream *stream = pa_stream_new_with_proplist(pulseDaemon()->context(), m_name.constData(), &m_pulseSpec, 0, propList);
     pa_proplist_free(propList);