Commit 19546cfe authored by Timo Rothenpieler's avatar Timo Rothenpieler

avcodec/cuviddec: properly take deinterlacing and display delay into account for buffer_full check

Signed-off-by: 's avatarTimo Rothenpieler <timo@rothenpieler.org>
parent 40c4b9da
......@@ -378,7 +378,11 @@ static int cuvid_is_buffer_full(AVCodecContext *avctx)
{
CuvidContext *ctx = avctx->priv_data;
return (av_fifo_size(ctx->frame_queue) / sizeof(CuvidParsedFrame)) + 2 > ctx->nb_surfaces;
int delay = ctx->cuparseinfo.ulMaxDisplayDelay;
if (ctx->deint_mode != cudaVideoDeinterlaceMode_Weave && !ctx->drop_second_field)
delay *= 2;
return (av_fifo_size(ctx->frame_queue) / sizeof(CuvidParsedFrame)) + delay >= ctx->nb_surfaces;
}
static int cuvid_decode_packet(AVCodecContext *avctx, const AVPacket *avpkt)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment