summaryrefslogtreecommitdiffstats
path: root/demux/demux.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-14 14:29:21 +0100
committerwm4 <wm4@nowhere>2015-02-14 14:29:21 +0100
commitde0f3747ee13c300f9b073a6a3da984318aed40a (patch)
treed13084574304af46cb925886440822e07f34c8ed /demux/demux.c
parentbf46f4c99714d2df105c3c004aa96680b4dda749 (diff)
downloadmpv-de0f3747ee13c300f9b073a6a3da984318aed40a.tar.bz2
mpv-de0f3747ee13c300f9b073a6a3da984318aed40a.tar.xz
demux: fix dropped subtitle packets with the new stream switching
If the previous subtitle packet is too far back, and the refresh seek won't pick it up, and the packet never comes again. As a consequence, the refresh mode was never stopped on the subtitle stream, which caused all packets to be discarded. Fix by assuming the file position is monotonically increasing; then it will resume even if a packet _after_ the intended resume point is returned. This introduces a new requirement on how the demuxer behaves. (I'm not sure if mp4 actually satisfies this requirement in all cases.) Fixes a regression introduced by commit f9f2e1cc.
Diffstat (limited to 'demux/demux.c')
-rw-r--r--demux/demux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/demux/demux.c b/demux/demux.c
index 50fc32cb96..61c8e40b8c 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -309,8 +309,8 @@ int demux_add_packet(struct sh_stream *stream, demux_packet_t *dp)
if (ds->refreshing) {
// Resume reading once the old position was reached (i.e. we start
// returning packets where we left off before the refresh).
- drop = true;
- if (dp->pos == ds->last_pos)
+ drop = dp->pos <= ds->last_pos;
+ if (dp->pos >= ds->last_pos)
ds->refreshing = false;
}