1
0
Fork 0
forked from len0rd/rockbox

Comment and make pretty the hack

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9761 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Brandon Low 2006-04-22 15:13:53 +00:00
parent c71ad7ea7f
commit f42459ff3b

View file

@ -34,6 +34,8 @@ struct mad_synth synth IBSS_ATTR;
void abort(void) { void abort(void) {
} }
/* These extra 8 bytes fake-added to each read make mad decode the last frame */
#define MAD_BUFFER_GUARD 8
#define INPUT_CHUNK_SIZE 8192 #define INPUT_CHUNK_SIZE 8192
mad_fixed_t mad_frame_overlap[2][32][18] IBSS_ATTR; mad_fixed_t mad_frame_overlap[2][32][18] IBSS_ATTR;
@ -181,7 +183,8 @@ enum codec_status codec_start(struct codec_api *api)
inputbuffer = ci->request_buffer(&size, INPUT_CHUNK_SIZE); inputbuffer = ci->request_buffer(&size, INPUT_CHUNK_SIZE);
if (size == 0 || inputbuffer == NULL) if (size == 0 || inputbuffer == NULL)
break; break;
mad_stream_buffer(&stream, (unsigned char *)inputbuffer, size + 8); mad_stream_buffer(&stream, (unsigned char *)inputbuffer,
size + MAD_BUFFER_GUARD);
} }
if (mad_frame_decode(&frame, &stream)) { if (mad_frame_decode(&frame, &stream)) {