stereo outputs twice as much data. now it works!

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6430 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
shatty 2004-01-30 09:00:11 +00:00
parent 619fa324f4
commit ba47158dc9

View File

@ -256,7 +256,6 @@ SpeexDecoder::Decode(void *buffer, int64 *frameCount,
mediaHeader->start_time = fStartTime;
//TRACE("SpeexDecoder: Decoding start time %.6f\n", fStartTime / 1000000.0);
// debugger("SpeexDecoder::Decode");
while (out_bytes_needed >= fSpeexOutputLength) {
// get a new packet
void *chunkBuffer;
@ -292,11 +291,11 @@ SpeexDecoder::Decode(void *buffer, int64 *frameCount,
if (fHeader->nb_channels == 2) {
speex_decode_stereo(out_buffer, fHeader->frame_size, fStereoState);
}
for (int i = 0 ; i < fHeader->frame_size ; i++) {
for (int i = 0 ; i < fHeader->frame_size * fHeader->nb_channels ; i++) {
out_buffer[i] /= 32000.0;
}
out_buffer += fHeader->frame_size;
out_bytes_needed -= fHeader->frame_size*sizeof(float);
out_buffer += fHeader->frame_size * fHeader->nb_channels;
out_bytes_needed -= fSpeexOutputLength;
}
}