summaryrefslogtreecommitdiff
path: root/apps/codecs/raac.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/raac.c')
-rw-r--r--apps/codecs/raac.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/codecs/raac.c b/apps/codecs/raac.c
index b886136bd9..516828093d 100644
--- a/apps/codecs/raac.c
+++ b/apps/codecs/raac.c
@@ -48,6 +48,7 @@ enum codec_status codec_main(void)
48 uint32_t s = 0; /* sample rate */ 48 uint32_t s = 0; /* sample rate */
49 unsigned char c = 0; /* channels */ 49 unsigned char c = 0; /* channels */
50 int playback_on = -1; 50 int playback_on = -1;
51 size_t resume_offset = ci->id3->offset;
51 52
52 /* Generic codec initialisation */ 53 /* Generic codec initialisation */
53 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED); 54 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED);
@@ -91,6 +92,15 @@ next_track:
91 err = CODEC_ERROR; 92 err = CODEC_ERROR;
92 goto done; 93 goto done;
93 } 94 }
95
96 /* check for a mid-track resume and force a seek time accordingly */
97 if(resume_offset > rmctx.data_offset + DATA_HEADER_SIZE) {
98 resume_offset -= rmctx.data_offset + DATA_HEADER_SIZE;
99 /* put number of subpackets to skip in resume_offset */
100 resume_offset /= (rmctx.block_align + PACKET_HEADER_SIZE);
101 ci->seek_time = (int)resume_offset * ((rmctx.block_align * 8 * 1000)/rmctx.bit_rate);
102 }
103
94 ci->id3->frequency = s; 104 ci->id3->frequency = s;
95 ci->set_elapsed(0); 105 ci->set_elapsed(0);
96 ci->advance_buffer(rmctx.data_offset + DATA_HEADER_SIZE); 106 ci->advance_buffer(rmctx.data_offset + DATA_HEADER_SIZE);