[FFmpeg-cvslog] lavc/encode: remove redundant av_init_packet after av_packet_unref.

Jun Zhao git at videolan.org
Thu Aug 23 14:18:30 EEST 2018


ffmpeg | branch: master | Jun Zhao <mypopydev at gmail.com> | Thu Aug 16 14:33:23 2018 +0800| [c9ed7f002492c7901f8638d8765bf4532dc2900a] | committer: Jun Zhao

lavc/encode: remove redundant av_init_packet after av_packet_unref.

remove redundant av_init_packet after av_packet_unref.
av_packet_unref have call av_init_packet and reset the packet size.

Signed-off-by: Jun Zhao <mypopydev at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c9ed7f002492c7901f8638d8765bf4532dc2900a
---

 libavcodec/encode.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index d9761515aa..0ebd8dd6a5 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -135,7 +135,6 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
 
     if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY) && !frame) {
         av_packet_unref(avpkt);
-        av_init_packet(avpkt);
         return 0;
     }
 
@@ -241,7 +240,6 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
 
     if (ret < 0 || !*got_packet_ptr) {
         av_packet_unref(avpkt);
-        av_init_packet(avpkt);
         goto end;
     }
 
@@ -282,8 +280,6 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
 
     if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY) && !frame) {
         av_packet_unref(avpkt);
-        av_init_packet(avpkt);
-        avpkt->size = 0;
         return 0;
     }
 



More information about the ffmpeg-cvslog mailing list