diff --git a/libmpdemux/demux_ts.c b/libmpdemux/demux_ts.c index da41f14c5a..3eb108913a 100644 --- a/libmpdemux/demux_ts.c +++ b/libmpdemux/demux_ts.c @@ -1065,7 +1065,9 @@ static demuxer_t *demux_open_ts(demuxer_t * demuxer) 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);