Module: libav
Branch: master
Commit: 28db30aa29e04c4f0cd43936ccea0752cfc57739

Author:    Luca Barbato <lu_z...@gentoo.org>
Committer: Luca Barbato <lu_z...@gentoo.org>
Date:      Thu Mar 29 12:00:37 2012 -0700

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.

---

 libavformat/output-example.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/output-example.c b/libavformat/output-example.c
index 86324b4..a467109 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;
 

_______________________________________________
libav-commits mailing list
libav-commits@libav.org
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to