summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2010-03-14 13:37:41 +0000
committerMagnus Holmgren <magnushol@gmail.com>2010-03-14 13:37:41 +0000
commita0692a40b238669059822f1af0bb11a1c9d20639 (patch)
tree0b2a54e5769fd1a659674ac27f9e0e99fb428955
parent1f725ebe34a55d000d6ca08d303de089b3ad7e80 (diff)
downloadrockbox-a0692a40b238669059822f1af0bb11a1c9d20639.tar.gz
rockbox-a0692a40b238669059822f1af0bb11a1c9d20639.zip
Make resume handling in the AAC codec less confusing. No functional change.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25165 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/aac.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/apps/codecs/aac.c b/apps/codecs/aac.c
index 7d706f4fd8..73267752c9 100644
--- a/apps/codecs/aac.c
+++ b/apps/codecs/aac.c
@@ -71,7 +71,7 @@ next_track:
while (!*ci->taginfo_ready && !ci->stop_codec)
ci->sleep(1);
- sound_samples_done = ci->id3->offset;
+ file_offset = ci->id3->offset;
ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency);
codec_set_replaygain(ci->id3);
@@ -110,8 +110,8 @@ next_track:
i = 0;
- if (sound_samples_done > 0) {
- if (alac_seek_raw(&demux_res, &input_stream, sound_samples_done,
+ if (file_offset > 0) {
+ if (alac_seek_raw(&demux_res, &input_stream, file_offset,
&sound_samples_done, (int*) &i)) {
elapsed_time = (sound_samples_done * 10) / (ci->id3->frequency / 100);
ci->set_elapsed(elapsed_time);
@@ -189,7 +189,7 @@ next_track:
goto done;
}
- /* Advance codec buffer */
+ /* Advance codec buffer (no need to call set_offset because of this) */
ci->advance_buffer(n);
/* Output the audio */
@@ -239,10 +239,6 @@ next_track:
sound_samples_done += sample_duration;
elapsed_time = (sound_samples_done * 10) / (ci->id3->frequency / 100);
ci->set_elapsed(elapsed_time);
-
- /* Keep track of current position - for resuming */
- ci->set_offset(elapsed_time);
-
i++;
}