From 018de50cfdd6d49c4da2943a0c97dd3705a2f6e8 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Sat, 9 Jul 2011 18:27:45 -0700 Subject: [PATCH] protocol-native: Fix backward compatibility break This makes sure we don't perform a check on record stream volumes for clients that don't support them. --- src/pulsecore/protocol-native.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c index 6b9817544..f26750de7 100644 --- a/src/pulsecore/protocol-native.c +++ b/src/pulsecore/protocol-native.c @@ -2243,7 +2243,7 @@ static void command_create_record_stream(pa_pdispatch *pd, uint32_t command, uin peak_detect = FALSE, early_requests = FALSE, dont_inhibit_auto_suspend = FALSE, - volume_set = TRUE, + volume_set = FALSE, muted_set = FALSE, fail_on_suspend = FALSE, relative_volume = FALSE, @@ -2334,6 +2334,9 @@ static void command_create_record_stream(pa_pdispatch *pd, uint32_t command, uin } if (c->version >= 22) { + /* For newer client versions (with per-source-output volumes), we try + * to make the behaviour for playback and record streams the same. */ + volume_set = TRUE; if (pa_tagstruct_getu8(t, &n_formats) < 0) { protocol_error(c); @@ -2368,7 +2371,8 @@ static void command_create_record_stream(pa_pdispatch *pd, uint32_t command, uin if (n_formats == 0) { CHECK_VALIDITY_GOTO(c->pstream, pa_sample_spec_valid(&ss), tag, PA_ERR_INVALID, finish); - CHECK_VALIDITY_GOTO(c->pstream, map.channels == ss.channels && volume.channels == ss.channels, tag, PA_ERR_INVALID, finish); + CHECK_VALIDITY_GOTO(c->pstream, map.channels == ss.channels, tag, PA_ERR_INVALID, finish); + CHECK_VALIDITY_GOTO(c->pstream, c->version < 22 || (volume.channels == ss.channels), tag, PA_ERR_INVALID, finish); CHECK_VALIDITY_GOTO(c->pstream, pa_channel_map_valid(&map), tag, PA_ERR_INVALID, finish); } else { PA_IDXSET_FOREACH(format, formats, i) {