[vlc-commits] demux: ts: reset buffers on seek and flag discontinuity

Francois Cartegnie git at videolan.org
Fri Apr 10 21:59:05 CEST 2015


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Apr 10 21:04:36 2015 +0200| [90919e2465d7e8427b52663227c217a575033a65] | committer: Jean-Baptiste Kempf

demux: ts: reset buffers on seek and flag discontinuity

Close #14078

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/ts.c |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/modules/demux/ts.c b/modules/demux/ts.c
index 5cc580b..377db21 100644
--- a/modules/demux/ts.c
+++ b/modules/demux/ts.c
@@ -2025,6 +2025,29 @@ static int Seek( demux_t *p_demux, double f_percent )
     }
     else
     {
+        for( int i = 2; i < 8192; i++ )
+        {
+            ts_pid_t *pid = &p_sys->pid[i];
+
+            if( !pid->b_valid || !pid->es || !pid->es->id )
+                continue;
+
+            if( pid->es->p_data )
+            {
+                block_ChainRelease( pid->es->p_data );
+                pid->es->p_data = NULL;
+                pid->es->i_data_size = 0;
+                pid->es->i_data_gathered = 0;
+                pid->es->pp_last = &pid->es->p_data;
+            }
+            block_t *p_reset = block_Alloc(1);
+            if( p_reset )
+            {
+                p_reset->i_buffer = 0;
+                p_reset->i_flags = BLOCK_FLAG_DISCONTINUITY | BLOCK_FLAG_CORRUPTED;
+                es_out_Send( p_demux->out, pid->es->id, p_reset );
+            }
+        }
         msg_Dbg( p_demux, "Seek():can find a time position. i_cnt:%d", i_cnt );
         return VLC_SUCCESS;
     }



More information about the vlc-commits mailing list