diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-04-14 21:29:43 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-04-14 21:29:43 +0200 |
commit | 333f8c6b59d9f94de1564840fa4475a313e4afa8 (patch) | |
tree | 1aca52c8b7835adde2d65913f96adc253f9bd4b9 /src/audio_out/audio_pulse_out.c | |
parent | cc3709b60de1db641ac66573980e1140a51b2370 (diff) | |
download | xine-lib-333f8c6b59d9f94de1564840fa4475a313e4afa8.tar.gz xine-lib-333f8c6b59d9f94de1564840fa4475a313e4afa8.tar.bz2 |
Make sure that muting/unmuting the audio without setting the volume does not put the volume to zero.
Diffstat (limited to 'src/audio_out/audio_pulse_out.c')
-rw-r--r-- | src/audio_out/audio_pulse_out.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/audio_out/audio_pulse_out.c b/src/audio_out/audio_pulse_out.c index fa58cf011..5a25db5ff 100644 --- a/src/audio_out/audio_pulse_out.c +++ b/src/audio_out/audio_pulse_out.c @@ -669,9 +669,15 @@ static int ao_pulse_set_property (ao_driver_t *this_gen, int property, int value o = pa_context_set_sink_input_mute(this->context, pa_stream_get_index(this->stream), value, __xine_pa_context_success_callback, this); #else - /* FIXME: breaks (volume=0 after unmuting) unless the volume is - * adjusted first (due to swvolume not being initialised properly) - */ + /* Get the current volume, so we can restore it properly. */ + o = pa_context_get_sink_input_info(this->context, pa_stream_get_index(this->stream), + __xine_pa_sink_info_callback, this); + + if (o) { + wait_for_operation(this, o); + pa_operation_unref(o); + } + if ( value ) pa_cvolume_mute(&this->cvolume, pa_stream_get_sample_spec(this->stream)->channels); else |