passthrough: Fix what volume we set sinks/sources to
authorArun Raghavan <arun.raghavan@collabora.co.uk>
Thu, 25 Aug 2011 15:47:51 +0000 (21:17 +0530)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Thu, 25 Aug 2011 15:49:31 +0000 (21:19 +0530)
Devices' 0 dB is base_volume not PA_VOLUME_NORM.

src/pulsecore/sink.c
src/pulsecore/source.c

index b6c260f78ce29613f11d63b43dd23baf5f4284d3..b0c360d66b21651d02ddbbd6f403d3620df2b962 100644 (file)
@@ -1406,7 +1406,7 @@ void pa_sink_enter_passthrough(pa_sink *s) {
     s->saved_volume = *pa_sink_get_volume(s, TRUE);
     s->saved_save_volume = s->save_volume;
 
-    pa_cvolume_set(&volume, s->sample_spec.channels, PA_VOLUME_NORM);
+    pa_cvolume_set(&volume, s->sample_spec.channels, s->base_volume);
     pa_sink_set_volume(s, &volume, TRUE, FALSE);
 }
 
index 4605656e215bd8080c4409876a10e1af6c59783d..d79dbb15f94f792c1dca0522e374429587819aff 100644 (file)
@@ -986,7 +986,7 @@ void pa_source_enter_passthrough(pa_source *s) {
     s->saved_volume = *pa_source_get_volume(s, TRUE);
     s->saved_save_volume = s->save_volume;
 
-    pa_cvolume_set(&volume, s->sample_spec.channels, PA_VOLUME_NORM);
+    pa_cvolume_set(&volume, s->sample_spec.channels, s->base_volume);
     pa_source_set_volume(s, &volume, TRUE, FALSE);
 }