[vlc-commits] mosaic bridge: implement SOUT_STREAM_IS_SYNCHRONOUS

Rémi Denis-Courmont git at videolan.org
Sun Oct 11 14:18:45 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Oct 10 14:05:49 2020 +0300| [e201f824615a4700c66655650f6dcf8665dad8c6] | committer: Rémi Denis-Courmont

mosaic bridge: implement SOUT_STREAM_IS_SYNCHRONOUS

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

 modules/stream_out/es.c            |  7 ++++---
 modules/stream_out/mosaic_bridge.c | 21 ++++++++++++++++++---
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/modules/stream_out/es.c b/modules/stream_out/es.c
index f242d05434..dd4b0381bc 100644
--- a/modules/stream_out/es.c
+++ b/modules/stream_out/es.c
@@ -39,6 +39,7 @@ typedef struct
     int  i_count_audio;
     int  i_count_video;
     int  i_count;
+    unsigned int count_sync;
 
     char *psz_mux;
     char *psz_mux_audio;
@@ -237,13 +238,13 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
         return NULL;
     }
 
-    p_stream->p_sout->i_out_pace_nocontrol += id->synchronous;
+    p_sys->count_sync += id->synchronous;
     return id;
 }
 
 static void Del( sout_stream_t *p_stream, void *_id )
 {
-    VLC_UNUSED(p_stream);
+    sout_stream_sys_t *sys = p_stream->p_sys;
     sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
     sout_access_out_t *p_access = id->p_mux->p_access;
 
@@ -251,7 +252,7 @@ static void Del( sout_stream_t *p_stream, void *_id )
     sout_MuxDelete( id->p_mux );
     sout_AccessOutDelete( p_access );
 
-    p_stream->p_sout->i_out_pace_nocontrol -= id->synchronous;
+    sys->count_sync -= id->synchronous;
     free( id );
 }
 
diff --git a/modules/stream_out/mosaic_bridge.c b/modules/stream_out/mosaic_bridge.c
index 2f3a0007d6..74e780566c 100644
--- a/modules/stream_out/mosaic_bridge.c
+++ b/modules/stream_out/mosaic_bridge.c
@@ -168,8 +168,25 @@ vlc_module_begin ()
     set_callbacks( Open, Close )
 vlc_module_end ()
 
+static int Control(sout_stream_t *stream, int query, va_list args)
+{
+    (void) stream;
+
+    switch (query)
+    {
+        case SOUT_STREAM_IS_SYNCHRONOUS:
+            *va_arg(args, bool *) = true;
+            break;
+
+        default:
+            return VLC_EGENERIC;
+    }
+
+    return VLC_SUCCESS;
+}
+
 static const struct sout_stream_operations ops = {
-    Add, Del, Send, NULL, NULL,
+    Add, Del, Send, Control, NULL,
 };
 
 static const char *const ppsz_sout_options[] = {
@@ -252,8 +269,6 @@ static int Open( vlc_object_t *p_this )
 #undef INT_COMMAND
 
     p_stream->ops = &ops;
-    p_stream->pace_nocontrol = true;
-
     return VLC_SUCCESS;
 }
 



More information about the vlc-commits mailing list