[pulseaudio-discuss] [PATCH] native: Don't save device, volume or mute of new streams.

Tanu Kaskinen tanu.kaskinen at digia.com
Thu Apr 5 06:24:48 PDT 2012


Specifying the volume when creating a new stream is not an
equivalent act as setting the volume with a volume control
application. When creating a new stream, stream-restore
shouldn't save the volume, but when changing the volume,
then saving it is ok. For example, when I say
"paplay --volume=10000 somefile.wav", I mean that I want the
new stream to have volume 10000. I don't mean that also
future paplay invocations (without the --volume option)
should have that same volume.

This patch effectively reverts
546bcf3f2f9711f0d08c21c3b775994844e7e2a2.
---
 src/pulsecore/protocol-native.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 41fc0a0..ea738d1 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -662,7 +662,7 @@ static record_stream* record_stream_new(
     data.module = c->options->module;
     data.client = c->client;
     if (source)
-        pa_source_output_new_data_set_source(&data, source, TRUE);
+        pa_source_output_new_data_set_source(&data, source, FALSE);
     if (pa_sample_spec_valid(ss))
         pa_source_output_new_data_set_sample_spec(&data, ss);
     if (pa_channel_map_valid(map))
@@ -673,11 +673,11 @@ static record_stream* record_stream_new(
     if (volume) {
         pa_source_output_new_data_set_volume(&data, volume);
         data.volume_is_absolute = !relative_volume;
-        data.save_volume = TRUE;
+        data.save_volume = FALSE;
     }
     if (muted_set) {
         pa_source_output_new_data_set_muted(&data, muted);
-        data.save_muted = TRUE;
+        data.save_muted = FALSE;
     }
     if (peak_detect)
         data.resample_method = PA_RESAMPLER_PEAKS;
@@ -1122,7 +1122,7 @@ static playback_stream* playback_stream_new(
     data.module = c->options->module;
     data.client = c->client;
     if (sink)
-        pa_sink_input_new_data_set_sink(&data, sink, TRUE);
+        pa_sink_input_new_data_set_sink(&data, sink, FALSE);
     if (pa_sample_spec_valid(ss))
         pa_sink_input_new_data_set_sample_spec(&data, ss);
     if (pa_channel_map_valid(map))
@@ -1135,11 +1135,11 @@ static playback_stream* playback_stream_new(
     if (volume) {
         pa_sink_input_new_data_set_volume(&data, volume);
         data.volume_is_absolute = !relative_volume;
-        data.save_volume = TRUE;
+        data.save_volume = FALSE;
     }
     if (muted_set) {
         pa_sink_input_new_data_set_muted(&data, muted);
-        data.save_muted = TRUE;
+        data.save_muted = FALSE;
     }
     data.sync_base = ssync ? ssync->sink_input : NULL;
     data.flags = flags;
-- 
1.7.8



More information about the pulseaudio-discuss mailing list