Commit a1977e01 authored by Justin Ruggles's avatar Justin Ruggles

lavc: shrink encoded audio packet size after encoding.

parent 777365fe
......@@ -960,8 +960,15 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
if (fs_tmp)
avctx->frame_size = fs_tmp;
}
if (!ret)
if (!ret) {
if (!user_packet && avpkt->data) {
uint8_t *new_data = av_realloc(avpkt->data, avpkt->size);
if (new_data)
avpkt->data = new_data;
}
avctx->frame_number++;
}
if (ret < 0 || !*got_packet_ptr)
av_free_packet(avpkt);
......
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