]> git.sesse.net Git - vlc/commitdiff
sout: mux: flag discontinuity when joining streams
authorFrancois Cartegnie <fcvlcdev@free.fr>
Tue, 10 Jun 2014 12:08:50 +0000 (14:08 +0200)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Wed, 11 Jun 2014 17:12:18 +0000 (19:12 +0200)
Both streams must have same format, but dts/pts/pcr
could start anywhere.

modules/stream_out/gather.c

index 055cdf61c80ce769feda32a9106410aa05d94dc8..ebad0e1c1fe609b7516bd8367e060e0d71532bbb 100644 (file)
@@ -33,6 +33,7 @@
 #include <vlc_plugin.h>
 #include <vlc_input.h>
 #include <vlc_sout.h>
+#include <vlc_block.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -57,6 +58,7 @@ static int               Send( sout_stream_t *, sout_stream_id_sys_t *, block_t*
 struct sout_stream_id_sys_t
 {
     bool    b_used;
+    bool    b_streamswap;
 
     es_format_t fmt;
     void          *id;
@@ -154,6 +156,7 @@ static sout_stream_id_sys_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
         /* */
         msg_Dbg( p_stream, "reusing already opened output" );
         id->b_used = true;
+        id->b_streamswap = true;
         return id;
     }
 
@@ -206,5 +209,10 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
 static int Send( sout_stream_t *p_stream,
                  sout_stream_id_sys_t *id, block_t *p_buffer )
 {
+    if ( id->b_streamswap )
+    {
+        id->b_streamswap = false;
+        p_buffer->i_flags |= BLOCK_FLAG_DISCONTINUITY;
+    }
     return sout_StreamIdSend( p_stream->p_next, id->id, p_buffer );
 }