]> code.delx.au - pulseaudio/commitdiff
tunnel: fix parsing of sink info from newer servers
authorEmil Renner Berthing <esmil@mailme.dk>
Sun, 20 Sep 2009 19:28:23 +0000 (21:28 +0200)
committerColin Guthrie <cguthrie@mandriva.org>
Sun, 20 Sep 2009 20:28:49 +0000 (21:28 +0100)
src/modules/module-tunnel.c

index af4b8b2acbc40c088ebd46bf3ff2a97e0b3266cf..1740448a4505c1767aa3ba128dc2a02eb3a04ad5 100644 (file)
@@ -1069,6 +1069,33 @@ static void sink_info_cb(pa_pdispatch *pd, uint32_t command,  uint32_t tag, pa_t
         }
     }
 
+    if (u->version >= 16) {
+        uint32_t n_ports, j;
+        const char *s;
+
+        if (pa_tagstruct_getu32(t, &n_ports)) {
+            pa_log("Parse failure");
+            goto fail;
+        }
+
+        for (j = 0; j < n_ports; j++) {
+            uint32_t priority;
+
+            if (pa_tagstruct_gets(t, &s) < 0 || /* name */
+                pa_tagstruct_gets(t, &s) < 0 || /* description */
+                pa_tagstruct_getu32(t, &priority) < 0) {
+
+                pa_log("Parse failure");
+                goto fail;
+            }
+        }
+
+        if (pa_tagstruct_gets(t, &s) < 0) { /* active port */
+            pa_log("Parse failure");
+            goto fail;
+        }
+    }
+
     if (!pa_tagstruct_eof(t)) {
         pa_log("Packet too long");
         goto fail;