speex codec changed to use unpacked packets (more generic)

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6559 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
shatty
2004-02-11 04:22:45 +00:00
parent 1c60b2d928
commit 2e8a6e27d0
@@ -266,12 +266,7 @@ SpeexDecoder::Decode(void *buffer, int64 *frameCount,
TRACE("SpeexDecoder::Decode: GetNextChunk failed\n");
return status;
}
if (chunkSize != sizeof(ogg_packet)) {
TRACE("SpeexDecoder::Decode: chunk not ogg_packet-sized\n");
return B_ERROR;
}
ogg_packet * packet = static_cast<ogg_packet*>(chunkBuffer);
speex_bits_read_from(&fBits, (char*)packet->packet, packet->bytes);
speex_bits_read_from(&fBits, (char*)chunkBuffer, chunkSize);
for (int frame = 0 ; frame < fHeader->frames_per_packet ; frame++) {
int ret = speex_decode(fDecoderState, &fBits, out_buffer);
if (ret == -1) {