summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2012-03-29 12:00:37 -0700
committerLuca Barbato <lu_zero@gentoo.org>2012-03-29 17:07:19 -0700
commit28db30aa29e04c4f0cd43936ccea0752cfc57739 (patch)
treef498de252c2a8588343eb63bc44aa84a96dc0801
parent4f7c7624c0db185c48c59d95d745ab3f7851a5b4 (diff)
avf: fix audio writing in the output-example
av_init_packet does not reset data and size fields in AVPacket, avcodec_encode_audio2 can use preallocated AVPacket.
-rw-r--r--libavformat/output-example.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/output-example.c b/libavformat/output-example.c
index 86324b4842..a467109fdb 100644
--- 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;