diff options
author | Emil Renner Berthing <esmil@mailme.dk> | 2009-09-20 21:28:23 +0200 |
---|---|---|
committer | Colin Guthrie <cguthrie@mandriva.org> | 2009-09-20 21:44:35 +0100 |
commit | 3684a7c7294923703d33b0092630478ebcdbe951 (patch) | |
tree | 0e32e270a67c23df460d16df9e045ea7f7014b6c | |
parent | 6c0317dbdf32794d29463e7559e6fb7bd57da8b3 (diff) |
tunnel: fix parsing of sink info from newer servers
-rw-r--r-- | src/modules/module-tunnel.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c index af4b8b2a..1740448a 100644 --- a/src/modules/module-tunnel.c +++ b/src/modules/module-tunnel.c @@ -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; |