]> code.delx.au - pulseaudio/commitdiff
protocol-native: Fix backward compatibility break
authorArun Raghavan <arun.raghavan@collabora.co.uk>
Sun, 10 Jul 2011 01:27:45 +0000 (18:27 -0700)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Sun, 10 Jul 2011 02:16:18 +0000 (19:16 -0700)
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

index 6b98175444cff8169c448c1cbc17d0ce5fc094f4..f26750de7d76f07e159d8208790e54327edee19d 100644 (file)
@@ -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) {