diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2011-02-20 15:27:10 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2011-02-20 15:27:10 +0000 |
commit | 85e40257dc65e3542b785898ddf60482e2d1ab0c (patch) | |
tree | f7bf9b33decce4296fbea0f437252f40aba6d5de /apps/codecs/wav.c | |
parent | 460d54977ae2f9c2c5997c6c4cd5541ab436d718 (diff) | |
download | rockbox-85e40257dc65e3542b785898ddf60482e2d1ab0c.tar.gz rockbox-85e40257dc65e3542b785898ddf60482e2d1ab0c.zip |
Enforce that codecs wait for their metadata in a proper-ish and consistent manner. Sort of a halfway patch; best would be to give them an internal copy of the current track information which lasts unaltered by playback until a track switch or unload.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29348 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/wav.c')
-rw-r--r-- | apps/codecs/wav.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/codecs/wav.c b/apps/codecs/wav.c index e286f4dc6a..e179470f27 100644 --- a/apps/codecs/wav.c +++ b/apps/codecs/wav.c | |||
@@ -153,7 +153,7 @@ static uint8_t *read_buffer(size_t *realsize) | |||
153 | /* this is the codec entry point */ | 153 | /* this is the codec entry point */ |
154 | enum codec_status codec_main(void) | 154 | enum codec_status codec_main(void) |
155 | { | 155 | { |
156 | int status = CODEC_OK; | 156 | int status; |
157 | uint32_t decodedsamples; | 157 | uint32_t decodedsamples; |
158 | size_t n; | 158 | size_t n; |
159 | int bufcount; | 159 | int bufcount; |
@@ -168,14 +168,16 @@ enum codec_status codec_main(void) | |||
168 | ci->configure(DSP_SET_SAMPLE_DEPTH, PCM_OUTPUT_DEPTH-1); | 168 | ci->configure(DSP_SET_SAMPLE_DEPTH, PCM_OUTPUT_DEPTH-1); |
169 | 169 | ||
170 | next_track: | 170 | next_track: |
171 | status = CODEC_OK; | ||
172 | |||
171 | if (codec_init()) { | 173 | if (codec_init()) { |
172 | DEBUGF("codec_init() error\n"); | 174 | DEBUGF("codec_init() error\n"); |
173 | status = CODEC_ERROR; | 175 | status = CODEC_ERROR; |
174 | goto exit; | 176 | goto exit; |
175 | } | 177 | } |
176 | 178 | ||
177 | while (!*ci->taginfo_ready && !ci->stop_codec) | 179 | if (codec_wait_taginfo() != 0) |
178 | ci->sleep(1); | 180 | goto done; |
179 | 181 | ||
180 | codec_set_replaygain(ci->id3); | 182 | codec_set_replaygain(ci->id3); |
181 | 183 | ||
@@ -437,7 +439,6 @@ next_track: | |||
437 | endofstream = 1; | 439 | endofstream = 1; |
438 | ci->set_elapsed(decodedsamples*1000LL/ci->id3->frequency); | 440 | ci->set_elapsed(decodedsamples*1000LL/ci->id3->frequency); |
439 | } | 441 | } |
440 | status = CODEC_OK; | ||
441 | 442 | ||
442 | done: | 443 | done: |
443 | if (ci->request_next_track()) | 444 | if (ci->request_next_track()) |