git.videolan.org
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
777365f
)
lavc: shrink encoded audio packet size after encoding.
author
Justin Ruggles
<justin.ruggles@gmail.com>
Tue, 20 Mar 2012 17:21:52 +0000
(13:21 -0400)
committer
Justin Ruggles
<justin.ruggles@gmail.com>
Tue, 20 Mar 2012 18:12:54 +0000
(14:12 -0400)
libavcodec/utils.c
patch
|
blob
|
history
diff --git
a/libavcodec/utils.c
b/libavcodec/utils.c
index
fc48f02
..
a638bbf
100644
(file)
--- a/
libavcodec/utils.c
+++ b/
libavcodec/utils.c
@@
-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);