This updates the tunnel module for protocol version >= 19.
module-tunnel-sink does not proxy server-side passthrough support (yet).
This would require a few more changes, namely keeping track of what
formats are available and if any other sink inputs are connected on the
server-side.
+ if (u->version >= 21) {
+ uint8_t n_formats;
+ pa_format_info format;
+
+ if (pa_tagstruct_getu8(t, &n_formats) < 0) { /* no. of formats */
+ pa_log("Parse failure");
+ goto fail;
+ }
+
+ for (uint8_t j = 0; j < n_formats; j++) {
+ if (pa_tagstruct_get_format_info(t, &format)) { /* format info */
+ pa_log("Parse failure");
+ goto fail;
+ }
+ }
+ }
+
if (!pa_tagstruct_eof(t)) {
pa_log("Packet too long");
goto fail;
if (!pa_tagstruct_eof(t)) {
pa_log("Packet too long");
goto fail;
pa_channel_map channel_map;
pa_cvolume volume;
pa_proplist *pl;
pa_channel_map channel_map;
pa_cvolume volume;
pa_proplist *pl;
pa_assert(pd);
pa_assert(u);
pa_assert(pd);
pa_assert(u);
+ if (u->version >= 19) {
+ if (pa_tagstruct_get_boolean(t, &b) < 0) {
+
+ pa_log("Parse failure");
+ goto fail;
+ }
+ }
+
+ if (u->version >= 20) {
+ if (pa_tagstruct_get_boolean(t, &b) < 0 ||
+ pa_tagstruct_get_boolean(t, &b) < 0) {
+
+ pa_log("Parse failure");
+ goto fail;
+ }
+ }
+
+ if (u->version >= 21) {
+ pa_format_info format;
+
+ if (pa_tagstruct_get_format_info(t, &format) < 0) {
+
+ pa_log("Parse failure");
+ goto fail;
+ }
+ }
+
if (!pa_tagstruct_eof(t)) {
pa_log("Packet too long");
goto fail;
if (!pa_tagstruct_eof(t)) {
pa_log("Packet too long");
goto fail;
+ if (u->version >= 21) {
+ pa_format_info format;
+
+ if (pa_tagstruct_get_format_info(t, &format) < 0)
+ goto parse_error;
+ }
+
if (!pa_tagstruct_eof(t))
goto parse_error;
if (!pa_tagstruct_eof(t))
goto parse_error;
pa_tagstruct_put_boolean(reply, FALSE); /* passthrough stream */
#endif
pa_tagstruct_put_boolean(reply, FALSE); /* passthrough stream */
#endif
+#ifdef TUNNEL_SINK
+ if (u->version >= 21) {
+ /* We're not using the extended API, so n_formats = 0 and that's that */
+ pa_tagstruct_putu8(t, 0);
+ }
+#endif
+
pa_pstream_send_tagstruct(u->pstream, reply);
pa_pdispatch_register_reply(u->pdispatch, tag, DEFAULT_TIMEOUT, create_stream_callback, u, NULL);
pa_pstream_send_tagstruct(u->pstream, reply);
pa_pdispatch_register_reply(u->pdispatch, tag, DEFAULT_TIMEOUT, create_stream_callback, u, NULL);