mirror of
https://github.com/mpv-player/mpv
synced 2025-03-11 08:37:59 +00:00
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.
This commit is contained in:
parent
781e9fcd66
commit
2d2d96f00b
@ -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])
|
||||
|
Loading…
Reference in New Issue
Block a user