Commit 5fae7f59 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#2209] Speex decode must return the number of bytes

parent 3be76947
......@@ -66,6 +66,8 @@ class Speex : public AudioCodec
speex_decoder_ctl (_speex_dec_state, SPEEX_GET_FRAME_SIZE, &_speex_frame_size);
#ifdef HAVE_SPEEXDSP_LIB
int enable = 1;
......@@ -109,11 +111,16 @@ class Speex : public AudioCodec
virtual int codecDecode (short *dst, unsigned char *src, unsigned int size) {
printf("_speex_frame_size: %i\n", _speex_frame_size);
printf("_frameSize: %i\n", _frameSize);
int ratio = 320 / _speex_frame_size;
speex_bits_read_from (&_speex_dec_bits, (char*) src, size);
speex_decode_int (_speex_dec_state, &_speex_dec_bits, dst);
return _frameSize;
// return size in bytes
return _frameSize * 2;
}
virtual int codecEncode (unsigned char *dst, short *src, unsigned int size) {
......
......@@ -109,6 +109,10 @@ class Speex : public AudioCodec
}
virtual int codecDecode (short *dst, unsigned char *src, unsigned int size) {
printf("------------------------------ codecDecode -------------------------\n");
printf("_speex_frame_size: %i\n", _speex_frame_size);
printf("_frameSize: %i\n", _frameSize);
// int ratio = 320 / _speex_frame_size;
speex_bits_read_from (&_speex_dec_bits, (char*) src, size);
......
......@@ -111,10 +111,14 @@ class Speex : public AudioCodec
int ratio = 320 / _speex_frame_size;
printf("_speex_frame_size: %i\n", _speex_frame_size);
printf("_frameSize: %i\n", _frameSize);
speex_bits_read_from (&_speex_dec_bits, (char*) src, size);
speex_decode_int (_speex_dec_state, &_speex_dec_bits, dst);
return _frameSize;
// return size in bytes
return _frameSize * 2;
}
virtual int codecEncode (unsigned char *dst, short *src, unsigned int size) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment