[vlc-commits] codec: webvtt: handle flush

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


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

codec: webvtt: handle flush

duplicate spu issue with demuxers not flagging discontinuity

(cherry picked from commit 8ef0512052e6fa47f19db503ab9da2161c9c59f6)

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

 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 bb12999783..ebe725fd3e 100644
--- a/modules/codec/webvtt/subsvtt.c
+++ b/modules/codec/webvtt/subsvtt.c
@@ -2002,6 +2002,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 )
@@ -2013,7 +2022,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
     mtime_t i_stop = i_start + p_block->i_length;
 
     if( p_block->i_flags & BLOCK_FLAG_DISCONTINUITY )
-        ClearCuesByTime( &p_dec->p_sys->p_root->p_child, INT64_MAX );
+        Flush( p_dec );
     else
         ClearCuesByTime( &p_dec->p_sys->p_root->p_child, i_start );
 
@@ -2068,6 +2077,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