diff options
author | Brandon Low <lostlogic@rockbox.org> | 2006-04-22 15:13:53 +0000 |
---|---|---|
committer | Brandon Low <lostlogic@rockbox.org> | 2006-04-22 15:13:53 +0000 |
commit | f42459ff3bb3f2c31d8c8b645c412d2fd2c66cd3 (patch) | |
tree | c8789ff457d15c5d7e03127a46c986bf11becf77 | |
parent | c71ad7ea7f005e6e84e60163837638eb958ae855 (diff) | |
download | rockbox-f42459ff3bb3f2c31d8c8b645c412d2fd2c66cd3.tar.gz rockbox-f42459ff3bb3f2c31d8c8b645c412d2fd2c66cd3.zip |
Comment and make pretty the hack
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9761 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/codecs/mpa.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/codecs/mpa.c b/apps/codecs/mpa.c index da449f4d8d..bbfbb574e6 100644 --- a/apps/codecs/mpa.c +++ b/apps/codecs/mpa.c | |||
@@ -34,6 +34,8 @@ struct mad_synth synth IBSS_ATTR; | |||
34 | void abort(void) { | 34 | void abort(void) { |
35 | } | 35 | } |
36 | 36 | ||
37 | /* These extra 8 bytes fake-added to each read make mad decode the last frame */ | ||
38 | #define MAD_BUFFER_GUARD 8 | ||
37 | #define INPUT_CHUNK_SIZE 8192 | 39 | #define INPUT_CHUNK_SIZE 8192 |
38 | 40 | ||
39 | mad_fixed_t mad_frame_overlap[2][32][18] IBSS_ATTR; | 41 | mad_fixed_t mad_frame_overlap[2][32][18] IBSS_ATTR; |
@@ -181,7 +183,8 @@ enum codec_status codec_start(struct codec_api *api) | |||
181 | inputbuffer = ci->request_buffer(&size, INPUT_CHUNK_SIZE); | 183 | inputbuffer = ci->request_buffer(&size, INPUT_CHUNK_SIZE); |
182 | if (size == 0 || inputbuffer == NULL) | 184 | if (size == 0 || inputbuffer == NULL) |
183 | break; | 185 | break; |
184 | mad_stream_buffer(&stream, (unsigned char *)inputbuffer, size + 8); | 186 | mad_stream_buffer(&stream, (unsigned char *)inputbuffer, |
187 | size + MAD_BUFFER_GUARD); | ||
185 | } | 188 | } |
186 | 189 | ||
187 | if (mad_frame_decode(&frame, &stream)) { | 190 | if (mad_frame_decode(&frame, &stream)) { |