summaryrefslogtreecommitdiffstats
path: root/demux/demux.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-05-16 16:56:43 +0200
committerwm4 <wm4@nowhere>2019-09-19 20:37:04 +0200
commit2d2d96f00b9b055d996bb9ba875be72491a3a74b (patch)
tree5c0d9584f98e163ca5ff891be2d01e96ccee92b5 /demux/demux.c
parent781e9fcd6663cac6f36c5f554bd19237a4102d19 (diff)
downloadmpv-2d2d96f00b9b055d996bb9ba875be72491a3a74b.tar.bz2
mpv-2d2d96f00b9b055d996bb9ba875be72491a3a74b.tar.xz
demux: don't process obscure skipped packets
When doing a seek to the end of the cache, ds->skip_to_keyframe can be set to true. Then some packets passed to add_packet_locked() may have to be skipped. In some aspects, the skipped packet was still treated as if it was going to be returned to the reader. It almost doesn't matter though: it only caused a redundant wakeup_ds() call, and could pass the packet to the stream recorder. Fix it anyway.
Diffstat (limited to 'demux/demux.c')
-rw-r--r--demux/demux.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/demux/demux.c b/demux/demux.c
index ff1573dca5..1a2495e8a9 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -1516,6 +1516,11 @@ static void add_packet_locked(struct sh_stream *stream, demux_packet_t *dp)
}
}
+ // Don't process the packet further if it's skipped by the previous seek
+ // (see reader_head check/assignment above).
+ if (!ds->reader_head)
+ return;
+
// (should preferably be outside of the lock)
if (in->enable_recording && !in->recorder &&
in->opts->record_file && in->opts->record_file[0])