diff options
author | Colin Guthrie <cguthrie@mandriva.org> | 2009-09-20 21:36:14 +0100 |
---|---|---|
committer | Colin Guthrie <cguthrie@mandriva.org> | 2009-09-20 21:36:14 +0100 |
commit | c194db71b0ff853b4f46df26e135edf63b215451 (patch) | |
tree | 94a5e1192a18f760dc00ff5b36e1f7ba36fd449b /src | |
parent | 592345fd3653c49438a4637133a500a09d58e081 (diff) |
tunnel: fix parsing of source info from newer servers
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/module-tunnel.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c index 1740448a..c97de3a1 100644 --- a/src/modules/module-tunnel.c +++ b/src/modules/module-tunnel.c @@ -1070,7 +1070,7 @@ 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; + uint32_t n_ports; const char *s; if (pa_tagstruct_getu32(t, &n_ports)) { @@ -1078,7 +1078,7 @@ static void sink_info_cb(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_t goto fail; } - for (j = 0; j < n_ports; j++) { + for (uint32_t j = 0; j < n_ports; j++) { uint32_t priority; if (pa_tagstruct_gets(t, &s) < 0 || /* name */ @@ -1272,6 +1272,33 @@ static void source_info_cb(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa } } + if (u->version >= 16) { + uint32_t n_ports; + const char *s; + + if (pa_tagstruct_getu32(t, &n_ports)) { + pa_log("Parse failure"); + goto fail; + } + + for (uint32_t 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; |