summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-05 16:56:36 +0200
committerwm4 <wm4@nowhere>2014-07-05 17:07:15 +0200
commit942619c779f9aba68c4eaaab086289ff53e41a4c (patch)
tree11661eddca9f0d7b1c975f41782435b9d780d9ce
parent85eb2bee3a25f34984cae919f3a8cd292fb92c31 (diff)
downloadmpv-942619c779f9aba68c4eaaab086289ff53e41a4c.tar.bz2
mpv-942619c779f9aba68c4eaaab086289ff53e41a4c.tar.xz
demux: set filepos field when dequeuing a packet
Otherwise the position can be too far ahead.
-rw-r--r--demux/demux.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/demux/demux.c b/demux/demux.c
index f3e57944d4..7b780c4411 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -205,9 +205,6 @@ int demuxer_add_packet(demuxer_t *demuxer, struct sh_stream *stream,
* appear. */
ds->eof = 0;
- if (dp->pos >= 0)
- demuxer->filepos = dp->pos;
-
// For video, PTS determination is not trivial, but for other media types
// distinguishing PTS and DTS is not useful.
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)
sh->demuxer->stream_pts = pkt->stream_pts;
+ if (pkt && pkt->pos >= 0)
+ sh->demuxer->filepos = pkt->pos;
return pkt;
}