summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-10-10 23:56:04 +0100
committerEdward Hervey <edward.hervey@collabora.co.uk>2011-10-31 11:14:03 +0100
commitdc80daec384dbb976f47d439b09a189d951560e4 (patch)
treedabb2deaabfa0011334ac7e277699c3900532290
parentd5e4fc3bbb5c70adcd35786ef72312e8acef411a (diff)
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.
-rw-r--r--ext/ffmpeg/gstffmpegenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/ffmpeg/gstffmpegenc.c b/ext/ffmpeg/gstffmpegenc.c
index 2e49b5a..f3dd34d 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);