From dd9ba4b2ad11076f69b9bc5fc2f898ee8d00512b Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Wed, 26 Jan 2011 22:08:49 +0100 Subject: [PATCH] AudioPulseAudio: do not initialize volume Instead of passing an initialized pa_cvolume structure, pass NULL as recommended by the documentation for pa_stream_connect_playback(). This fixes the volume erroneously being set to 100% at startup. Thanks to Thomas Moschny for forwarding the bug report. --- src/core/audio/AudioPulseAudio.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/audio/AudioPulseAudio.cpp b/src/core/audio/AudioPulseAudio.cpp index 3fb77c0f2..9e184b729 100644 --- a/src/core/audio/AudioPulseAudio.cpp +++ b/src/core/audio/AudioPulseAudio.cpp @@ -1,7 +1,7 @@ /* * AudioPulseAudio.cpp - device-class which implements PulseAudio-output * - * Copyright (c) 2008-2009 Tobias Doerffel + * Copyright (c) 2008-2011 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -164,7 +164,6 @@ static void context_state_callback(pa_context *c, void *userdata) case PA_CONTEXT_READY: { - pa_cvolume cv; qDebug( "Connection established.\n" ); _this->m_s = pa_stream_new( c, "lmms", &_this->m_sampleSpec, NULL); pa_stream_set_state_callback( _this->m_s, stream_state_callback, _this ); @@ -189,8 +188,7 @@ static void context_state_callback(pa_context *c, void *userdata) pa_stream_connect_playback( _this->m_s, NULL, &buffer_attr, PA_STREAM_ADJUST_LATENCY, - pa_cvolume_set( &cv, _this->m_sampleSpec.channels, - PA_VOLUME_NORM ), + NULL, // volume NULL ); break; }