[pulseaudio-discuss,3/7] tunnel-new: allow streams to be moved

Submitted by Pierre Ossman on May 23, 2016, 2:57 p.m.

Details

Message ID 20160523165752.238cf200@ossman.lkpg.cendio.se
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in PulseAudio

Not browsing as part of any series.

Commit Message

Pierre Ossman May 23, 2016, 2:57 p.m.
Signed-off-by: Pierre Ossman <ossman@cendio.se>
---
 src/modules/module-tunnel-sink-new.c   | 8 +++++++-
 src/modules/module-tunnel-source-new.c | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

{ pa_log_debug("Could not create stream: %s",
pa_strerror(pa_context_errno(u->context)));
u->thread_mainloop_api->quit(u->thread_mainloop_api,
TUNNEL_THREAD_FAILED_MAINLOOP); }

Patch hide | download patch | download mbox

diff --git a/src/modules/module-tunnel-sink-new.c
b/src/modules/module-tunnel-sink-new.c index bec6e8c..6989f73 100644
--- a/src/modules/module-tunnel-sink-new.c
+++ b/src/modules/module-tunnel-sink-new.c
@@ -290,6 +290,11 @@  static void stream_set_buffer_attr_cb(pa_stream
*stream, int success, void *user stream_changed_buffer_attr_cb(stream,
userdata); }
 
+/* called after the server has moved our input to a different sink */
+static void stream_moved_callback(pa_stream *stream, void *userdata) {
+    stream_changed_buffer_attr_cb(stream, userdata);
+}
+
 /* called when the server experiences an underrun of our buffer */
 static void stream_underflow_callback(pa_stream *stream, void
*userdata) { pa_log_info("Server signalled buffer underrun.");
@@ -350,12 +355,13 @@  static void context_state_cb(pa_context *c, void
*userdata) { 
             pa_stream_set_state_callback(u->stream, stream_state_cb,
userdata); pa_stream_set_buffer_attr_callback(u->stream,
stream_changed_buffer_attr_cb, userdata);
+            pa_stream_set_moved_callback(u->stream,
stream_moved_callback, userdata);
pa_stream_set_underflow_callback(u->stream, stream_underflow_callback,
userdata); pa_stream_set_overflow_callback(u->stream,
stream_overflow_callback, userdata); if
(pa_stream_connect_playback(u->stream, u->remote_sink_name, &bufferattr,
-
PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_DONT_MOVE |
PA_STREAM_START_CORKED | PA_STREAM_AUTO_TIMING_UPDATE,
+
PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_START_CORKED |
PA_STREAM_AUTO_TIMING_UPDATE, NULL, NULL) < 0) {
                 pa_log_error("Could not connect stream.");
diff --git a/src/modules/module-tunnel-source-new.c
b/src/modules/module-tunnel-source-new.c index d911fa9..1fd0e69 100644
--- a/src/modules/module-tunnel-source-new.c
+++ b/src/modules/module-tunnel-source-new.c
@@ -336,7 +336,7 @@  static void context_state_cb(pa_context *c, void
*userdata) { if (pa_stream_connect_record(u->stream,
                                          u->remote_source_name,
                                          &bufferattr,
-
PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_DONT_MOVE|PA_STREAM_AUTO_TIMING_UPDATE|PA_STREAM_START_CORKED)
< 0) {
+                                         PA_STREAM_INTERPOLATE_TIMING
| PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_START_CORKED) < 0)