|
|
|
@ -18,12 +18,6 @@ size_t mp3dec_read_callback(void *buf, size_t size, void *user_data)
@@ -18,12 +18,6 @@ size_t mp3dec_read_callback(void *buf, size_t size, void *user_data)
|
|
|
|
|
{ |
|
|
|
|
AudioStream_s *stream = static_cast<AudioStream_s*>( (void*)user_data); |
|
|
|
|
|
|
|
|
|
if( stream->decode_size > 0) |
|
|
|
|
{ |
|
|
|
|
printf("mp3dec_read_callback size: %d\n", (int)size); |
|
|
|
|
return size; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int ret_size = stream->stream_event->StreamRequestData( buf, size, stream->offset ); |
|
|
|
|
printf("mp3dec_read_callback size: %d, ret_size: %d\n", (int)size, ret_size); |
|
|
|
|
stream->offset += ret_size; |
|
|
|
@ -104,20 +98,8 @@ CMiniMP3::~CMiniMP3()
@@ -104,20 +98,8 @@ CMiniMP3::~CMiniMP3()
|
|
|
|
|
// IAudioStream functions
|
|
|
|
|
int CMiniMP3::Decode( void *pBuffer, unsigned int bufferSize ) |
|
|
|
|
{ |
|
|
|
|
printf("CMiniMP3::Decode size: %d\n", bufferSize); |
|
|
|
|
audio_stream.decode_size = 1; |
|
|
|
|
unsigned int readed = mp3dec_ex_read(&mp3d, (mp3d_sample_t*)pBuffer, bufferSize/2); |
|
|
|
|
printf("mp3dec_ex_read %d\n", readed); |
|
|
|
|
printf("dec.samples: %d\n", (int)mp3d.samples); |
|
|
|
|
|
|
|
|
|
if (readed != mp3d.samples) /* normal eof or error condition */ |
|
|
|
|
{ |
|
|
|
|
if (mp3d.last_error) |
|
|
|
|
{ |
|
|
|
|
printf("last_err: %d\n", mp3d.last_error); |
|
|
|
|
/* error */ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
size_t readed = mp3dec_ex_read(&mp3d, pBuffer, 1152); |
|
|
|
|
printf("CMiniMP3::Decode: readed samples: %d\n", readed); |
|
|
|
|
|
|
|
|
|
return readed; |
|
|
|
|
} |
|
|
|
|