You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avformat/av1dec: Flush BSF upon seeking
The av1_merge_frame BSF outputs its cached data when it sees the beginning of a new frame, i.e. when it sees a temporal delimiter OBU. Therefore it typically has a temporal delimiter OBU cached after outputting a packet. This implies that the OBU demuxer must flush its BSF upon seeking because otherwise the first frame returned after a seek consists of an old temporal delimiter OBU only. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -390,6 +390,10 @@ static int obu_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
AV1DemuxContext *const c = s->priv_data;
|
||||
int ret;
|
||||
|
||||
if (s->io_repositioned) {
|
||||
av_bsf_flush(c->bsf);
|
||||
s->io_repositioned = 0;
|
||||
}
|
||||
while (1) {
|
||||
ret = obu_get_packet(s, pkt);
|
||||
/* In case of AVERROR_EOF we need to flush the BSF. Conveniently
|
||||
|
Reference in New Issue
Block a user