diff options
author | Robin Burchell <robin.burchell@jollamobile.com> | 2014-01-16 15:28:06 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-07 13:23:27 +0100 |
commit | 87b8b4489a96983a7e98e74ee656e6225ff982f3 (patch) | |
tree | 5aab3a652cfe575ff02fdd90dff6eeb0d4451147 /src | |
parent | 1e23440457d64e6dec53b6b465d783673b6e9956 (diff) | |
download | qtmultimedia-87b8b4489a96983a7e98e74ee656e6225ff982f3.tar.gz |
QAudioOutput: Don't guess media role if one has not been provided in setCategory.
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.
This fixes QAudioOutput not respecting system volume on Sailfish.
Change-Id: If1d05192f513eb54fdfbd1df217286f329b2bfe8
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/pulseaudio/qaudiooutput_pulse.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/plugins/pulseaudio/qaudiooutput_pulse.cpp b/src/plugins/pulseaudio/qaudiooutput_pulse.cpp index cd3265819..2b482ba40 100644 --- a/src/plugins/pulseaudio/qaudiooutput_pulse.cpp +++ b/src/plugins/pulseaudio/qaudiooutput_pulse.cpp @@ -277,16 +277,8 @@ bool QPulseAudioOutput::open() qint64 bytesPerSecond = m_format.sampleRate() * m_format.channelCount() * m_format.sampleSize() / 8; 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" - // We choose music unless the buffer size is small, where we choose game.. - if (m_bufferSize > 0 && bytesPerSecond > 0 && (m_bufferSize * 1000LL / bytesPerSecond <= LowLatencyBufferSizeMs)) { - m_category = LOW_LATENCY_CATEGORY_NAME; - } else { - m_category = "music"; - } - } - pa_proplist_sets(propList, PA_PROP_MEDIA_ROLE, m_category.toLatin1().constData()); + if (!m_category.isNull()) + pa_proplist_sets(propList, PA_PROP_MEDIA_ROLE, m_category.toLatin1().constData()); m_stream = pa_stream_new_with_proplist(pulseEngine->context(), m_streamName.constData(), &spec, 0, propList); pa_proplist_free(propList); |