projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4f7c762
)
avf: fix audio writing in the output-example
author
Luca Barbato
<lu_zero@gentoo.org>
Thu, 29 Mar 2012 19:00:37 +0000
(12:00 -0700)
committer
Luca Barbato
<lu_zero@gentoo.org>
Fri, 30 Mar 2012 00:07:19 +0000
(17:07 -0700)
av_init_packet does not reset data and size fields in AVPacket,
avcodec_encode_audio2 can use preallocated AVPacket.
libavformat/output-example.c
patch
|
blob
|
history
diff --git
a/libavformat/output-example.c
b/libavformat/output-example.c
index
86324b4
..
a467109
100644
(file)
--- a/
libavformat/output-example.c
+++ b/
libavformat/output-example.c
@@
-138,7
+138,7
@@
static void get_audio_frame(int16_t *samples, int frame_size, int nb_channels)
static void write_audio_frame(AVFormatContext *oc, AVStream *st)
{
AVCodecContext *c;
- AVPacket pkt;
+ AVPacket pkt
= { 0 }; // data and size must be 0
;
AVFrame *frame = avcodec_alloc_frame();
int got_packet;