changeset 32548:ffbacc2a87fc

Fix TS demuxer with -sb and when -aid stream is not found. Make it seek back to the stream->start_pos position instead of 0 in that case. Fixes bug 1790.
author reimar
date Sat, 20 Nov 2010 10:47:58 +0000
parents 6a629e6fdb09
children cf1f4f5bc096
files libmpdemux/demux_ts.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ts.c	Thu Nov 18 20:20:39 2010 +0000
+++ b/libmpdemux/demux_ts.c	Sat Nov 20 10:47:58 2010 +0000
@@ -1063,7 +1063,9 @@
 	mp_msg(MSGT_DEMUXER,MSGL_V, "Opened TS demuxer, audio: %x(pid %d), video: %x(pid %d)...POS=%"PRIu64", PROBE=%"PRIu64"\n", params.atype, demuxer->audio->id, params.vtype, demuxer->video->id, (uint64_t) start_pos, ts_probe);
 
 
-	start_pos = (start_pos <= priv->ts.packet_size ? 0 : start_pos - priv->ts.packet_size);
+	start_pos = start_pos <= priv->ts.packet_size ?
+                    demuxer->stream->start_pos :
+                    start_pos - priv->ts.packet_size;
 	demuxer->movi_start = start_pos;
 	demuxer->reference_clock = MP_NOPTS_VALUE;
 	stream_reset(demuxer->stream);