native: Don't save device, volume or mute of new streams.

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
546bcf3f2f.
This commit is contained in:
Tanu Kaskinen 2012-04-05 16:24:48 +03:00 committed by Tanu Kaskinen
parent 8fb63dd6e4
commit 9b4332eca4

View file

@ -662,7 +662,7 @@ static record_stream* record_stream_new(
data.module = c->options->module; data.module = c->options->module;
data.client = c->client; data.client = c->client;
if (source) 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)) if (pa_sample_spec_valid(ss))
pa_source_output_new_data_set_sample_spec(&data, ss); pa_source_output_new_data_set_sample_spec(&data, ss);
if (pa_channel_map_valid(map)) if (pa_channel_map_valid(map))
@ -673,11 +673,11 @@ static record_stream* record_stream_new(
if (volume) { if (volume) {
pa_source_output_new_data_set_volume(&data, volume); pa_source_output_new_data_set_volume(&data, volume);
data.volume_is_absolute = !relative_volume; data.volume_is_absolute = !relative_volume;
data.save_volume = TRUE; data.save_volume = FALSE;
} }
if (muted_set) { if (muted_set) {
pa_source_output_new_data_set_muted(&data, muted); pa_source_output_new_data_set_muted(&data, muted);
data.save_muted = TRUE; data.save_muted = FALSE;
} }
if (peak_detect) if (peak_detect)
data.resample_method = PA_RESAMPLER_PEAKS; data.resample_method = PA_RESAMPLER_PEAKS;
@ -1122,7 +1122,7 @@ static playback_stream* playback_stream_new(
data.module = c->options->module; data.module = c->options->module;
data.client = c->client; data.client = c->client;
if (sink) 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)) if (pa_sample_spec_valid(ss))
pa_sink_input_new_data_set_sample_spec(&data, ss); pa_sink_input_new_data_set_sample_spec(&data, ss);
if (pa_channel_map_valid(map)) if (pa_channel_map_valid(map))
@ -1135,11 +1135,11 @@ static playback_stream* playback_stream_new(
if (volume) { if (volume) {
pa_sink_input_new_data_set_volume(&data, volume); pa_sink_input_new_data_set_volume(&data, volume);
data.volume_is_absolute = !relative_volume; data.volume_is_absolute = !relative_volume;
data.save_volume = TRUE; data.save_volume = FALSE;
} }
if (muted_set) { if (muted_set) {
pa_sink_input_new_data_set_muted(&data, muted); 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.sync_base = ssync ? ssync->sink_input : NULL;
data.flags = flags; data.flags = flags;