[vlc-commits] sout: enforce discontinuity flag after flush

Francois Cartegnie git at videolan.org
Sat May 5 19:41:08 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat May  5 10:11:00 2018 +0200| [d55028e4ed6c9bfddabb4657e9bc342df65d3a7e] | committer: Rémi Denis-Courmont

sout: enforce discontinuity flag after flush

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

 src/stream_output/stream_output.c | 7 +++++++
 src/stream_output/stream_output.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c
index 65ab0b5ebd..292615119b 100644
--- a/src/stream_output/stream_output.c
+++ b/src/stream_output/stream_output.c
@@ -163,6 +163,7 @@ sout_packetizer_input_t *sout_InputNew( sout_instance_t *p_sout,
         return NULL;
 
     p_input->p_sout = p_sout;
+    p_input->b_flushed = false;
 
     msg_Dbg( p_sout, "adding a new sout input for `%4.4s` (sout_input: %p)",
              (char*) &p_fmt->i_codec, (void *)p_input );
@@ -221,6 +222,7 @@ void sout_InputFlush( sout_packetizer_input_t *p_input )
     vlc_mutex_lock( &p_sout->lock );
     sout_StreamFlush( p_sout->p_stream, p_input->id );
     vlc_mutex_unlock( &p_sout->lock );
+    p_input->b_flushed = true;
 }
 
 /*****************************************************************************
@@ -232,6 +234,11 @@ int sout_InputSendBuffer( sout_packetizer_input_t *p_input,
     sout_instance_t     *p_sout = p_input->p_sout;
     int                 i_ret;
 
+    if( p_input->b_flushed )
+    {
+        p_buffer->i_flags |= BLOCK_FLAG_DISCONTINUITY;
+        p_input->b_flushed = false;
+    }
     vlc_mutex_lock( &p_sout->lock );
     i_ret = sout_StreamIdSend( p_sout->p_stream, p_input->id, p_buffer );
     vlc_mutex_unlock( &p_sout->lock );
diff --git a/src/stream_output/stream_output.h b/src/stream_output/stream_output.h
index d855be6930..38c6be5902 100644
--- a/src/stream_output/stream_output.h
+++ b/src/stream_output/stream_output.h
@@ -38,6 +38,7 @@ struct sout_packetizer_input_t
     sout_instance_t     *p_sout;
 
     void                *id;
+    bool                 b_flushed;
 };
 
 sout_instance_t *sout_NewInstance( vlc_object_t *, const char * );



More information about the vlc-commits mailing list