|
|
@ -2051,9 +2051,17 @@ int ff_nvenc_send_frame(AVCodecContext *avctx, const AVFrame *frame) |
|
|
|
if ((!ctx->cu_context && !ctx->d3d11_device) || !ctx->nvencoder) |
|
|
|
if ((!ctx->cu_context && !ctx->d3d11_device) || !ctx->nvencoder) |
|
|
|
return AVERROR(EINVAL); |
|
|
|
return AVERROR(EINVAL); |
|
|
|
|
|
|
|
|
|
|
|
if (ctx->encoder_flushing) |
|
|
|
if (ctx->encoder_flushing) { |
|
|
|
|
|
|
|
if (avctx->internal->draining) |
|
|
|
return AVERROR_EOF; |
|
|
|
return AVERROR_EOF; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ctx->encoder_flushing = 0; |
|
|
|
|
|
|
|
ctx->first_packet_output = 0; |
|
|
|
|
|
|
|
ctx->initial_pts[0] = AV_NOPTS_VALUE; |
|
|
|
|
|
|
|
ctx->initial_pts[1] = AV_NOPTS_VALUE; |
|
|
|
|
|
|
|
av_fifo_reset(ctx->timestamp_list); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (frame) { |
|
|
|
if (frame) { |
|
|
|
in_surf = get_free_frame(ctx); |
|
|
|
in_surf = get_free_frame(ctx); |
|
|
|
if (!in_surf) |
|
|
|
if (!in_surf) |
|
|
|