#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
#include <pulsecore/core-subscribe.h>
-#include <pulsecore/sink-input.h>
#include <pulsecore/pdispatch.h>
#include <pulsecore/pstream.h>
#include <pulsecore/pstream-util.h>
#include <pulsecore/socket-client.h>
-#include <pulsecore/socket-util.h>
#include <pulsecore/time-smoother.h>
#include <pulsecore/thread.h>
#include <pulsecore/thread-mq.h>
case PA_SINK_MESSAGE_SET_STATE: {
int r;
- /* First, change the state, because otherwide pa_sink_render() would fail */
+ /* First, change the state, because otherwise pa_sink_render() would fail */
if ((r = pa_sink_process_msg(o, code, data, offset, chunk)) >= 0) {
stream_cork_within_thread(u, u->sink->state == PA_SINK_SUSPENDED);
}
}
+ 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++) {
+ format = pa_format_info_new();
+ if (pa_tagstruct_get_format_info(t, format)) { /* format info */
+ pa_format_info_free(format);
+ pa_log("Parse failure");
+ goto fail;
+ }
+ pa_format_info_free(format);
+ }
+ }
+
if (!pa_tagstruct_eof(t)) {
pa_log("Packet too long");
goto fail;
pa_channel_map channel_map;
pa_cvolume volume;
pa_proplist *pl;
+ pa_bool_t b;
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 = pa_format_info_new();
+
+ if (pa_tagstruct_get_format_info(t, format) < 0) {
+ pa_format_info_free(format);
+ pa_log("Parse failure");
+ goto fail;
+ }
+ pa_format_info_free(format);
+ }
+
if (!pa_tagstruct_eof(t)) {
pa_log("Packet too long");
goto fail;
/* #endif */
}
+ if (u->version >= 21) {
+ pa_format_info *format = pa_format_info_new();
+
+ if (pa_tagstruct_get_format_info(t, format) < 0) {
+ pa_format_info_free(format);
+ goto parse_error;
+ }
+
+ pa_format_info_free(format);
+ }
+
if (!pa_tagstruct_eof(t))
goto parse_error;
if (u->version >= 17)
pa_tagstruct_put_boolean(reply, FALSE); /* relative volume */
- if (u->version >= 18) {
- pa_tagstruct_put_boolean(reply, FALSE); /* passthough stream */
+ if (u->version >= 18)
+ 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(reply, 0);
+ }
#endif
pa_pstream_send_tagstruct(u->pstream, reply);
goto fail;
}
- u->sink = pa_sink_new(m->core, &data, PA_SINK_NETWORK|PA_SINK_LATENCY|PA_SINK_HW_VOLUME_CTRL|PA_SINK_HW_MUTE_CTRL);
+ u->sink = pa_sink_new(m->core, &data, PA_SINK_NETWORK|PA_SINK_LATENCY);
pa_sink_new_data_done(&data);
if (!u->sink) {
u->sink->parent.process_msg = sink_process_msg;
u->sink->userdata = u;
u->sink->set_state = sink_set_state;
- u->sink->set_volume = sink_set_volume;
- u->sink->set_mute = sink_set_mute;
+ pa_sink_set_set_volume_callback(u->sink, sink_set_volume);
+ pa_sink_set_set_mute_callback(u->sink, sink_set_mute);
u->sink->refresh_volume = u->sink->refresh_muted = FALSE;