]> git.sesse.net Git - ffmpeg/commitdiff
lavc/encode: remove redundant av_init_packet after av_packet_unref.
authorJun Zhao <mypopydev@gmail.com>
Thu, 16 Aug 2018 06:33:23 +0000 (14:33 +0800)
committerJun Zhao <jun.zhao@intel.com>
Thu, 23 Aug 2018 11:17:16 +0000 (19:17 +0800)
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@gmail.com>
libavcodec/encode.c

index d9761515aa84e2ccdf5040fdabd6fb9af310bc4f..0ebd8dd6a55ea99bf7a4012df918a4e9ca537cbe 100644 (file)
@@ -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;
     }