vlc | branch: master | Thomas Guillem <tho...@gllm.fr> | Thu Sep 22 16:40:43 
2016 +0200| [a3925097aa23b6179ddf61bb04e43cd9a90e6f7f] | committer: Thomas 
Guillem

pulse: restart when we need to move a passthrough input

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a3925097aa23b6179ddf61bb04e43cd9a90e6f7f
---

 modules/audio_output/pulse.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index a088e44..bde37d3 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -75,6 +75,7 @@ struct aout_sys_t
     char *sink_force; /**< Forced sink name (stream must be NULL) */
 
     struct sink *sinks; /**< Locally-cached list of sinks */
+    bool passthrough;
 };
 
 static void VolumeReport(audio_output_t *aout)
@@ -655,6 +656,15 @@ static int StreamMove(audio_output_t *aout, const char 
*name)
         aout_DeviceReport(aout, name);
         return 0;
     }
+    else if (sys->passthrough)
+    {
+        /* A sink connected with a passthrough input cannot be moved */
+        msg_Dbg(aout, "request restart to connect to sink %s", name);
+        free(sys->sink_force);
+        sys->sink_force = strdup(name);
+        aout_RestartRequest(aout, AOUT_RESTART_OUTPUT);
+        return 0;
+    }
 
     pa_operation *op;
     uint32_t idx = pa_stream_get_index(sys->stream);
@@ -924,6 +934,7 @@ static int Start(audio_output_t *aout, 
audio_sample_format_t *restrict fmt)
     sys->flags_force = PA_STREAM_NOFLAGS;
     free(sys->sink_force);
     sys->sink_force = NULL;
+    sys->passthrough = fmt->i_format == VLC_CODEC_SPDIFL;
 
     if (encoding == PA_ENCODING_INVALID)
     {

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to