summaryrefslogtreecommitdiff
path: root/apps/codecs/a52_rm.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/a52_rm.c')
-rw-r--r--apps/codecs/a52_rm.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/codecs/a52_rm.c b/apps/codecs/a52_rm.c
index bc6c129ad2..f5e4923292 100644
--- a/apps/codecs/a52_rm.c
+++ b/apps/codecs/a52_rm.c
@@ -132,20 +132,24 @@ enum codec_status codec_main(void)
132 uint8_t *filebuf; 132 uint8_t *filebuf;
133 int retval, consumed, packet_offset; 133 int retval, consumed, packet_offset;
134 int playback_on = -1; 134 int playback_on = -1;
135 size_t resume_offset = ci->id3->offset; 135 size_t resume_offset;
136 136
137 /* Generic codec initialisation */ 137 /* Generic codec initialisation */
138 ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED); 138 ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED);
139 ci->configure(DSP_SET_SAMPLE_DEPTH, 28); 139 ci->configure(DSP_SET_SAMPLE_DEPTH, 28);
140 140
141next_track: 141next_track:
142 retval = CODEC_OK;
143
142 if (codec_init()) { 144 if (codec_init()) {
143 retval = CODEC_ERROR; 145 retval = CODEC_ERROR;
144 goto exit; 146 goto exit;
145 } 147 }
146 148
147 while (!ci->taginfo_ready) 149 if (codec_wait_taginfo() != 0)
148 ci->yield(); 150 goto request_next_track;
151
152 resume_offset = ci->id3->offset;
149 153
150 ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency); 154 ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency);
151 codec_set_replaygain(ci->id3); 155 codec_set_replaygain(ci->id3);
@@ -201,8 +205,7 @@ next_track:
201 ci->advance_buffer(pkt.length); 205 ci->advance_buffer(pkt.length);
202 } 206 }
203 207
204 retval = CODEC_OK; 208request_next_track:
205
206 if (ci->request_next_track()) 209 if (ci->request_next_track())
207 goto next_track; 210 goto next_track;
208 211