[vlc-commits] demux: ts: don't set growing end on when not probed
Francois Cartegnie
git at videolan.org
Thu Feb 22 16:21:17 CET 2018
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Feb 22 16:05:45 2018 +0100| [5fab09cf3fdfdd5650596aea6b254f7058e962e9] | committer: Francois Cartegnie
demux: ts: don't set growing end on when not probed
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5fab09cf3fdfdd5650596aea6b254f7058e962e9
---
modules/demux/mpeg/ts.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index eb27d12f04..2523edb25e 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -2000,7 +2000,7 @@ static int SeekToTime( demux_t *p_demux, const ts_pmt_t *p_pmt, int64_t i_scaled
return VLC_SUCCESS;
}
-#define PROBE_CHUNK_COUNT 250
+#define PROBE_CHUNK_COUNT 2500
static int ProbeChunk( demux_t *p_demux, int i_program, bool b_end, int64_t *pi_pcr, bool *pb_found )
{
@@ -2211,8 +2211,13 @@ static void ProgramSetPCR( demux_t *p_demux, ts_pmt_t *p_pmt, mtime_t i_pcr )
if( p_sys->b_access_control == false &&
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 );
+ if( p_pmt->i_last_dts_byte == 0 ) /* first run */
+ p_pmt->i_last_dts_byte = stream_Size( p_sys->stream );
+ else
+ {
+ p_pmt->i_last_dts = i_pcr;
+ p_pmt->i_last_dts_byte = vlc_stream_Tell( p_sys->stream );
+ }
}
}
}
More information about the vlc-commits
mailing list