[vlc-commits] codec: webvtt: handle flush

Francois Cartegnie git at videolan.org
Wed Jul 18 12:02:41 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jul 18 12:01:08 2018 +0200| [8ef0512052e6fa47f19db503ab9da2161c9c59f6] | committer: Francois Cartegnie

codec: webvtt: handle flush

duplicate spu issue with demuxers not flagging discontinuity

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

 modules/codec/webvtt/subsvtt.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/modules/codec/webvtt/subsvtt.c b/modules/codec/webvtt/subsvtt.c
index 3ef73068f1..27ff9fd72e 100644
--- a/modules/codec/webvtt/subsvtt.c
+++ b/modules/codec/webvtt/subsvtt.c
@@ -2052,6 +2052,15 @@ static void LoadExtradata( decoder_t *p_dec )
 }
 
 /****************************************************************************
+ * Flush:
+ ****************************************************************************/
+static void Flush( decoder_t *p_dec )
+{
+    decoder_sys_t *p_sys = p_dec->p_sys;
+    ClearCuesByTime( &p_sys->p_root->p_child, INT64_MAX );
+}
+
+/****************************************************************************
  * DecodeBlock: decoder data entry point
  ****************************************************************************/
 static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
@@ -2065,7 +2074,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
     vlc_tick_t i_stop = i_start + p_block->i_length;
 
     if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
-        ClearCuesByTime( &p_sys->p_root->p_child, INT64_MAX );
+        Flush( p_dec );
     else
         ClearCuesByTime( &p_sys->p_root->p_child, i_start );
 
@@ -2120,6 +2129,7 @@ int webvtt_OpenDecoder( vlc_object_t *p_this )
     p_sys->p_root->psz_tag = strdup( "video" );
 
     p_dec->pf_decode = DecodeBlock;
+    p_dec->pf_flush  = Flush;
 
     if( p_dec->fmt_in.i_extra )
         LoadExtradata( p_dec );



More information about the vlc-commits mailing list