diff options
author | Adam Boot <rotator@gmail.com> | 2006-12-07 20:13:58 +0000 |
---|---|---|
committer | Adam Boot <rotator@gmail.com> | 2006-12-07 20:13:58 +0000 |
commit | 5931ab2e1345fd897ded74c7f01a254777ea4018 (patch) | |
tree | eaeb6c301c55c897d47c3c7500400a250f080546 | |
parent | a5ececcfef96840921f1d24df1d4adb0b00f8ad3 (diff) | |
download | rockbox-5931ab2e1345fd897ded74c7f01a254777ea4018.tar.gz rockbox-5931ab2e1345fd897ded74c7f01a254777ea4018.zip |
Minor corrections to FLAC seeking calculations
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11687 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/codecs/flac.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/codecs/flac.c b/apps/codecs/flac.c index b3cba32c82..4202763962 100644 --- a/apps/codecs/flac.c +++ b/apps/codecs/flac.c | |||
@@ -219,7 +219,7 @@ bool frame_sync(FLACContext* fc) { | |||
219 | 219 | ||
220 | /* Advance and init bit buffer to the new frame. */ | 220 | /* Advance and init bit buffer to the new frame. */ |
221 | ci->advance_buffer((get_bits_count(&fc->gb)-16)>>3); /* consumed bytes */ | 221 | ci->advance_buffer((get_bits_count(&fc->gb)-16)>>3); /* consumed bytes */ |
222 | bit_buffer = ci->request_buffer(&buff_size, MAX_FRAMESIZE); | 222 | bit_buffer = ci->request_buffer(&buff_size, MAX_FRAMESIZE+16); |
223 | init_get_bits(&fc->gb, bit_buffer, buff_size*8); | 223 | init_get_bits(&fc->gb, bit_buffer, buff_size*8); |
224 | 224 | ||
225 | /* Decode the frame to verify the frame crc and | 225 | /* Decode the frame to verify the frame crc and |
@@ -307,7 +307,7 @@ bool flac_seek(FLACContext* fc, uint32_t target_sample) { | |||
307 | if(!ci->seek_buffer(pos)) | 307 | if(!ci->seek_buffer(pos)) |
308 | return false; | 308 | return false; |
309 | 309 | ||
310 | bit_buffer = ci->request_buffer(&buff_size, MAX_FRAMESIZE); | 310 | bit_buffer = ci->request_buffer(&buff_size, MAX_FRAMESIZE+16); |
311 | init_get_bits(&fc->gb, bit_buffer, buff_size*8); | 311 | init_get_bits(&fc->gb, bit_buffer, buff_size*8); |
312 | 312 | ||
313 | /* Now we need to get a frame. It is possible for our seek | 313 | /* Now we need to get a frame. It is possible for our seek |
@@ -368,7 +368,7 @@ bool flac_seek(FLACContext* fc, uint32_t target_sample) { | |||
368 | 368 | ||
369 | /* We need to narrow the search. */ | 369 | /* We need to narrow the search. */ |
370 | if(target_sample < this_frame_sample) { | 370 | if(target_sample < this_frame_sample) { |
371 | upper_bound_sample = this_frame_sample + this_block_size; | 371 | upper_bound_sample = this_frame_sample; |
372 | upper_bound = ci->curpos; | 372 | upper_bound = ci->curpos; |
373 | } | 373 | } |
374 | else { /* Target is beyond this frame. */ | 374 | else { /* Target is beyond this frame. */ |