# HG changeset patch # User reimar # Date 1290250078 0 # Node ID ffbacc2a87fc28307f7b825c847a36c9db98d6b2 # Parent 6a629e6fdb097c111c1b23e7109ad3f0147e4bad 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. diff -r 6a629e6fdb09 -r ffbacc2a87fc libmpdemux/demux_ts.c --- 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);