[vlc-commits] codec: cc: clear screen and buffers on discontinuity

Francois Cartegnie git at videolan.org
Thu Aug 13 14:19:39 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Aug  8 00:41:05 2015 +0200| [5d75b486c4a3cd66d9d7cadec21bbcb542228c87] | committer: Francois Cartegnie

codec: cc: clear screen and buffers on discontinuity

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

 modules/codec/cc.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/modules/codec/cc.c b/modules/codec/cc.c
index d8fa66e..dfbfb65 100644
--- a/modules/codec/cc.c
+++ b/modules/codec/cc.c
@@ -250,6 +250,17 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
         if( !p_sys->p_block )
             p_sys->p_block = Pop( p_dec );
 
+        /* Reset decoder if needed */
+        if( p_sys->p_block &&
+           (p_sys->p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY | BLOCK_FLAG_CORRUPTED)) )
+        {
+            Eia608Init( &p_sys->eia608 );
+            p_sys->i_display_time = VLC_TS_INVALID;
+            /* clear flags, as we might process it more than once */
+            p_sys->p_block->i_flags ^= (BLOCK_FLAG_DISCONTINUITY | BLOCK_FLAG_CORRUPTED);
+            continue;
+        }
+
         if( !p_sys->p_block )
             break;
 



More information about the vlc-commits mailing list