Audio output buffer must now equal AVCODEC_MAX_AUDIO_FRAME_SIZE

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29837 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
David McPaul 2009-03-31 20:58:57 +00:00
parent b60892ce1c
commit a1f8af1f44

View File

@ -17,7 +17,7 @@
#include "avcodecplugin.h"
#undef TRACE
#define TRACE_AV_CODEC
//#define TRACE_AV_CODEC
#ifdef TRACE_AV_CODEC
# define TRACE(x...) printf(x)
#else
@ -115,7 +115,7 @@ avCodec::Setup(media_format *ioEncodedFormat, const void *infoBuffer,
TRACE("[%c] avCodec::Setup()\n", isAudio?('a'):('v'));
if (isAudio && !fOutputBuffer)
fOutputBuffer = new char[100000];
fOutputBuffer = new char[AVCODEC_MAX_AUDIO_FRAME_SIZE];
//#if DEBUG
char buffer[1024];
@ -462,7 +462,8 @@ avCodec::Decode(void *out_buffer, int64 *out_frameCount,
continue;
}
if (fOutputBufferSize == 0) {
int len, out_size;
int len;
int out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
len = avcodec_decode_audio2(ffc, (short *)fOutputBuffer,
&out_size, (uint8_t*)fChunkBuffer + fChunkBufferOffset,
fChunkBufferSize);