Commit c9ed7f00 authored by Jun Zhao's avatar Jun Zhao Committed by 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: 's avatarJun Zhao <mypopydev@gmail.com>
parent 70d2bab8
...@@ -135,7 +135,6 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx, ...@@ -135,7 +135,6 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY) && !frame) { if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY) && !frame) {
av_packet_unref(avpkt); av_packet_unref(avpkt);
av_init_packet(avpkt);
return 0; return 0;
} }
...@@ -241,7 +240,6 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx, ...@@ -241,7 +240,6 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
if (ret < 0 || !*got_packet_ptr) { if (ret < 0 || !*got_packet_ptr) {
av_packet_unref(avpkt); av_packet_unref(avpkt);
av_init_packet(avpkt);
goto end; goto end;
} }
...@@ -282,8 +280,6 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx, ...@@ -282,8 +280,6 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY) && !frame) { if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY) && !frame) {
av_packet_unref(avpkt); av_packet_unref(avpkt);
av_init_packet(avpkt);
avpkt->size = 0;
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment