[vlc-commits] demux: ts: flag discontinuity on post flush output
Francois Cartegnie
git at videolan.org
Thu Apr 27 19:48:24 CEST 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Apr 27 19:17:24 2017 +0200| [4ae6fa5d7b74fc9e07081dae9d3e5bdb35290641] | committer: Francois Cartegnie
demux: ts: flag discontinuity on post flush output
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4ae6fa5d7b74fc9e07081dae9d3e5bdb35290641
---
modules/demux/mpeg/ts.c | 24 ++++++++++--------------
modules/demux/mpeg/ts_streams.c | 1 +
modules/demux/mpeg/ts_streams_private.h | 1 +
3 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index e6291f116a..67526c2c06 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -1549,6 +1549,12 @@ static void ParsePESDataChain( demux_t *p_demux, ts_pid_t *pid, block_t *p_pes )
if ( p_block )
{
ts_pes_es_t *p_es_send = p_es;
+ if( p_es_send->i_next_block_flags )
+ {
+ p_block->i_flags |= p_es_send->i_next_block_flags;
+ p_es_send->i_next_block_flags = 0;
+ }
+
while( p_es_send )
{
if( p_es_send->p_program->b_selected )
@@ -1816,17 +1822,7 @@ static void ReadyQueuesPostSeek( demux_t *p_demux )
continue;
for( ts_pes_es_t *p_es = p_pes->p_es; p_es; p_es = p_es->p_next )
- {
- if( p_es->id && p_es->p_program->b_selected )
- {
- block_t *p_block = block_Alloc(0);
- if( p_block )
- {
- p_block->i_flags = BLOCK_FLAG_DISCONTINUITY | BLOCK_FLAG_CORRUPTED;
- es_out_Send( p_demux->out, p_es->id, p_block );
- }
- }
- }
+ p_es->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
pid->i_cc = 0xff;
@@ -2571,11 +2567,11 @@ static bool GatherPESData( demux_t *p_demux, ts_pid_t *pid, block_t *p_pkt, size
if( p_pkt->i_flags & BLOCK_FLAG_DISCONTINUITY )
{
p_pes->gather.i_saved = 0;
- /* Propagate to output block to notify packetizers/decoders */
- if( p_pes->gather.p_data )
- p_pes->gather.p_data->i_flags |= BLOCK_FLAG_DISCONTINUITY;
/* Flush/output current */
b_ret |= PushPESBlock( p_demux, pid, NULL, true );
+ /* Propagate to output block to notify packetizers/decoders */
+ if( p_pes->p_es )
+ p_pes->p_es->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
}
if ( unlikely(p_pes->gather.i_saved > 0) )
diff --git a/modules/demux/mpeg/ts_streams.c b/modules/demux/mpeg/ts_streams.c
index 74a3e4bc57..7f8d4b09d4 100644
--- a/modules/demux/mpeg/ts_streams.c
+++ b/modules/demux/mpeg/ts_streams.c
@@ -170,6 +170,7 @@ ts_pes_es_t * ts_pes_es_New( ts_pmt_t *p_program )
p_es->p_program = p_program;
p_es->id = NULL;
p_es->i_sl_es_id = 0;
+ p_es->i_next_block_flags = 0;
p_es->p_extraes = NULL;
p_es->p_next = NULL;
p_es->b_interlaced = false;
diff --git a/modules/demux/mpeg/ts_streams_private.h b/modules/demux/mpeg/ts_streams_private.h
index 25144efb47..ebb8f546c3 100644
--- a/modules/demux/mpeg/ts_streams_private.h
+++ b/modules/demux/mpeg/ts_streams_private.h
@@ -82,6 +82,7 @@ struct ts_pes_es_t
es_format_t fmt;
es_out_id_t *id;
uint16_t i_sl_es_id;
+ int i_next_block_flags;
ts_pes_es_t *p_extraes; /* Some private streams encapsulate several ES (eg. DVB subtitles) */
ts_pes_es_t *p_next; /* Next es on same pid from different pmt (shared pid) */
/* J2K stuff */
More information about the vlc-commits
mailing list