Skip to content

Commit

Permalink
Flushing buffers (related fcd1ed5)
Browse files Browse the repository at this point in the history
After 3bbe176 do not by default
open and close the codec in order to flush the video buffer.
  • Loading branch information
Asd-g committed Apr 2, 2024
1 parent 18f243b commit ea2b1ac
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions common/lwlibav_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ void lwlibav_flush_buffers
lwlibav_decode_handler_t *dhp
)
{
if (dhp->index_entries_count <= 1)
if (!strcmp(dhp->ctx->codec->name, "libdav1d")
&& dhp->ctx->level > 9)
avcodec_flush_buffers(dhp->ctx);
else if (dhp->ctx->codec_type == AVMEDIA_TYPE_VIDEO
&& strcmp(dhp->ctx->codec->name, "libdav1d"))
avcodec_flush_buffers(dhp->ctx);
else
{
const AVCodecParameters* codecpar = dhp->format->streams[dhp->stream_index]->codecpar;
const AVCodec* codec = dhp->ctx->codec;
Expand All @@ -67,8 +73,6 @@ void lwlibav_flush_buffers
dhp->ctx->opaque = app_specific;
}
}
else
avcodec_flush_buffers(dhp->ctx);

dhp->exh.delay_count = 0;
}
Expand Down

0 comments on commit ea2b1ac

Please sign in to comment.