lavc/encode: set frame_number for encoders using receive_packet()

It is currently set in encode_simple_internal(), which is only called
for encoders using the "simple" encoding API.
pull/379/head
Anton Khirnov 3 years ago
parent 67aceaf4ad
commit b780b6db64
  1. 7
      libavcodec/encode.c

@ -247,11 +247,8 @@ end:
if (ret < 0 || !got_packet)
av_packet_unref(avpkt);
if (frame) {
if (!ret)
avctx->frame_number++;
if (frame)
av_frame_unref(frame);
}
if (got_packet)
// Encoders must always return ref-counted buffers.
@ -383,6 +380,8 @@ int attribute_align_arg avcodec_send_frame(AVCodecContext *avctx, const AVFrame
return ret;
}
avctx->frame_number++;
return 0;
}

Loading…
Cancel
Save