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.
This commit is contained in:
Sjoerd Simons 2011-10-10 23:56:04 +01:00
parent b05352beee
commit eb2e9f48e3

View file

@ -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);