[vlc-commits] demux: ts: update position if file size changes (fix #17085)
Francois Cartegnie
git at videolan.org
Mon Mar 6 17:01:40 CET 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Mar 6 17:00:48 2017 +0100| [a4894df2e4aa6c71440efb5ba7099ad33cd378ea] | committer: Francois Cartegnie
demux: ts: update position if file size changes (fix #17085)
stupid case
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a4894df2e4aa6c71440efb5ba7099ad33cd378ea
---
modules/demux/mpeg/ts.c | 7 +++++++
modules/demux/mpeg/ts_streams.c | 1 +
modules/demux/mpeg/ts_streams_private.h | 1 +
3 files changed, 9 insertions(+)
diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index 2d60c1e..dcdf2fb 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -2025,6 +2025,7 @@ static int ProbeChunk( demux_t *p_demux, int i_program, bool b_end, int64_t *pi_
if( b_end )
{
p_pmt->i_last_dts = *pi_pcr;
+ p_pmt->i_last_dts_byte = vlc_stream_Tell( p_sys->stream );
}
/* Start, only keep first */
else if( b_pcrresult && p_pmt->pcr.i_first == -1 )
@@ -2154,6 +2155,12 @@ static void ProgramSetPCR( demux_t *p_demux, ts_pmt_t *p_pmt, mtime_t i_pcr )
if ( p_sys->i_pmt_es )
{
es_out_Control( p_demux->out, ES_OUT_SET_GROUP_PCR, p_pmt->i_number, FROM_SCALE(i_pcr) );
+ /* growing files/named fifo handling */
+ if( vlc_stream_Tell( p_sys->stream ) > p_pmt->i_last_dts_byte )
+ {
+ p_pmt->i_last_dts = i_pcr;
+ p_pmt->i_last_dts_byte = vlc_stream_Tell( p_sys->stream );
+ }
}
}
diff --git a/modules/demux/mpeg/ts_streams.c b/modules/demux/mpeg/ts_streams.c
index 6ee5230..74a3e4b 100644
--- a/modules/demux/mpeg/ts_streams.c
+++ b/modules/demux/mpeg/ts_streams.c
@@ -121,6 +121,7 @@ ts_pmt_t *ts_pmt_New( demux_t *p_demux )
ARRAY_INIT( pmt->od.objects );
pmt->i_last_dts = -1;
+ pmt->i_last_dts_byte = 0;
pmt->p_atsc_si_basepid = NULL;
pmt->p_si_sdt_pid = NULL;
diff --git a/modules/demux/mpeg/ts_streams_private.h b/modules/demux/mpeg/ts_streams_private.h
index b39d743..25144efb 100644
--- a/modules/demux/mpeg/ts_streams_private.h
+++ b/modules/demux/mpeg/ts_streams_private.h
@@ -72,6 +72,7 @@ struct ts_pmt_t
} eit;
mtime_t i_last_dts;
+ uint64_t i_last_dts_byte;
};
More information about the vlc-commits
mailing list