diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-10-29 00:46:22 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-10-29 00:46:22 +0100 |
commit | f27a50691c8fe45bac7dd6b21fac91a359def3a1 (patch) | |
tree | 740c6bd459931f7c894e038c57926b9d4d1ad6a4 /src/pulsecore/protocol-native.c | |
parent | 546bcf3f2f9711f0d08c21c3b775994844e7e2a2 (diff) |
libpulse: introduce PA_STREAM_RELATIVE_VOLUME
Diffstat (limited to 'src/pulsecore/protocol-native.c')
-rw-r--r-- | src/pulsecore/protocol-native.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c index 010420ef..bb29a196 100644 --- a/src/pulsecore/protocol-native.c +++ b/src/pulsecore/protocol-native.c @@ -1002,6 +1002,7 @@ static playback_stream* playback_stream_new( pa_proplist *p, pa_bool_t adjust_latency, pa_bool_t early_requests, + pa_bool_t relative_volume, int *ret) { playback_stream *s, *ssync; @@ -1052,7 +1053,7 @@ static playback_stream* playback_stream_new( pa_sink_input_new_data_set_channel_map(&data, map); if (volume) { pa_sink_input_new_data_set_volume(&data, volume); - data.volume_is_absolute = TRUE; + data.volume_is_absolute = !relative_volume; data.save_volume = TRUE; } if (muted_set) { @@ -1846,7 +1847,8 @@ static void command_create_playback_stream(pa_pdispatch *pd, uint32_t command, u early_requests = FALSE, dont_inhibit_auto_suspend = FALSE, muted_set = FALSE, - fail_on_suspend = FALSE; + fail_on_suspend = FALSE, + relative_volume = FALSE; pa_sink_input_flags_t flags = 0; pa_proplist *p; pa_bool_t volume_set = TRUE; @@ -1939,6 +1941,15 @@ static void command_create_playback_stream(pa_pdispatch *pd, uint32_t command, u } } + if (c->version >= 17) { + + if (pa_tagstruct_get_boolean(t, &relative_volume) < 0) { + protocol_error(c); + pa_proplist_free(p); + return; + } + } + if (!pa_tagstruct_eof(t)) { protocol_error(c); pa_proplist_free(p); @@ -1978,7 +1989,7 @@ static void command_create_playback_stream(pa_pdispatch *pd, uint32_t command, u * flag. For older versions we synthesize it here */ muted_set = muted_set || muted; - s = playback_stream_new(c, sink, &ss, &map, &attr, volume_set ? &volume : NULL, muted, muted_set, syncid, &missing, flags, p, adjust_latency, early_requests, &ret); + s = playback_stream_new(c, sink, &ss, &map, &attr, volume_set ? &volume : NULL, muted, muted_set, syncid, &missing, flags, p, adjust_latency, early_requests, relative_volume, &ret); pa_proplist_free(p); CHECK_VALIDITY(c->pstream, s, tag, ret); |