return (nb_ready > 0) && (nb_ready + nb_pending >= ctx->async_depth);
}
-static int reconfig_encoder(AVCodecContext *avctx, const AVFrame *frame)
+static void reconfig_encoder(AVCodecContext *avctx, const AVFrame *frame)
{
NvencContext *ctx = avctx->priv_data;
NV_ENCODE_API_FUNCTION_LIST *p_nvenc = &ctx->nvenc_dload_funcs.nvenc_funcs;
}
}
-
- return 0;
}
int ff_nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame)
return AVERROR_EOF;
if (frame) {
- reconfig_encoder(avctx, frame);
-
in_surf = get_free_frame(ctx);
if (!in_surf)
return AVERROR(EAGAIN);
if (res < 0)
return res;
+ reconfig_encoder(avctx, frame);
+
res = nvenc_upload_frame(avctx, frame, in_surf);
res2 = nvenc_pop_context(avctx);