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