mirror of
https://github.com/mpv-player/mpv
synced 2025-04-11 04:01:31 +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
27ea505269
commit
f2ff4527eb
@ -1515,6 +1515,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)
|
// (should preferably be outside of the lock)
|
||||||
if (in->enable_recording && !in->recorder &&
|
if (in->enable_recording && !in->recorder &&
|
||||||
in->opts->record_file && in->opts->record_file[0])
|
in->opts->record_file && in->opts->record_file[0])
|
||||||
|
Loading…
Reference in New Issue
Block a user