From eb2e9f48e33b777b33ce6f86062639b8a85ecdfb Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Mon, 10 Oct 2011 23:56:04 +0100 Subject: [PATCH] ffmpegenc: Pass the size of the output buffer to avcodec_encode_audio avcodec_encode_audio is documented as taking the size of the output buffer not the size of the input buffer. This fixes the use of the G722 encoder and makes the code more consistent with avconv from the libav source tree. --- ext/ffmpeg/gstffmpegenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ffmpeg/gstffmpegenc.c b/ext/ffmpeg/gstffmpegenc.c index 2e49b5a426..f3dd34d745 100644 --- a/ext/ffmpeg/gstffmpegenc.c +++ b/ext/ffmpeg/gstffmpegenc.c @@ -864,7 +864,7 @@ gst_ffmpegenc_encode_audio (GstFFMpegEnc * ffmpegenc, guint8 * audio_in, if (ffmpegenc->buffer_size != max_size) ffmpegenc->buffer_size = max_size; - res = avcodec_encode_audio (ctx, audio_out, in_size, (short *) audio_in); + res = avcodec_encode_audio (ctx, audio_out, max_size, (short *) audio_in); if (res < 0) { GST_ERROR_OBJECT (ffmpegenc, "Failed to encode buffer: %d", res);