1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-19 05:15:12 +00:00

demux: set filepos field when dequeuing a packet

Otherwise the position can be too far ahead.
This commit is contained in:
wm4 2014-07-05 16:56:36 +02:00
parent 85eb2bee3a
commit 942619c779

View File

@ -205,9 +205,6 @@ int demuxer_add_packet(demuxer_t *demuxer, struct sh_stream *stream,
* appear. */ * appear. */
ds->eof = 0; ds->eof = 0;
if (dp->pos >= 0)
demuxer->filepos = dp->pos;
// For video, PTS determination is not trivial, but for other media types // For video, PTS determination is not trivial, but for other media types
// distinguishing PTS and DTS is not useful. // distinguishing PTS and DTS is not useful.
if (stream->type != STREAM_VIDEO && dp->pts == MP_NOPTS_VALUE) if (stream->type != STREAM_VIDEO && dp->pts == MP_NOPTS_VALUE)
@ -294,6 +291,8 @@ struct demux_packet *demux_read_packet(struct sh_stream *sh)
if (pkt->stream_pts != MP_NOPTS_VALUE) if (pkt->stream_pts != MP_NOPTS_VALUE)
sh->demuxer->stream_pts = pkt->stream_pts; sh->demuxer->stream_pts = pkt->stream_pts;
if (pkt && pkt->pos >= 0)
sh->demuxer->filepos = pkt->pos;
return pkt; return pkt;
} }