Message ID | 20211213104726.24998-2-anton@khirnov.net |
---|---|
State | Accepted |
Commit | b780b6db649e693fb1aaebe0da6006a1a5055466 |
Headers | show |
Series | [FFmpeg-devel,1/2] lavc/encode: improve the empty frame check | expand |
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
andriy/make_ppc | success | Make finished |
andriy/make_fate_ppc | success | Make fate finished |
diff --git a/libavcodec/encode.c b/libavcodec/encode.c index 5575cf23db..618be0573d 100644 --- a/libavcodec/encode.c +++ b/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; }