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/vox.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/vox.c')
-rw-r--r-- | apps/codecs/vox.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/codecs/vox.c b/apps/codecs/vox.c index ff5d571e8d..c7f39342c3 100644 --- a/apps/codecs/vox.c +++ b/apps/codecs/vox.c | |||
@@ -46,7 +46,7 @@ static uint8_t *read_buffer(size_t *realsize) | |||
46 | /* this is the codec entry point */ | 46 | /* this is the codec entry point */ |
47 | enum codec_status codec_main(void) | 47 | enum codec_status codec_main(void) |
48 | { | 48 | { |
49 | int status = CODEC_OK; | 49 | int status; |
50 | uint32_t decodedsamples; | 50 | uint32_t decodedsamples; |
51 | size_t n; | 51 | size_t n; |
52 | int bufcount; | 52 | int bufcount; |
@@ -59,14 +59,16 @@ enum codec_status codec_main(void) | |||
59 | ci->configure(DSP_SET_SAMPLE_DEPTH, PCM_OUTPUT_DEPTH-1); | 59 | ci->configure(DSP_SET_SAMPLE_DEPTH, PCM_OUTPUT_DEPTH-1); |
60 | 60 | ||
61 | next_track: | 61 | next_track: |
62 | status = CODEC_OK; | ||
63 | |||
62 | if (codec_init()) { | 64 | if (codec_init()) { |
63 | DEBUGF("codec_init() error\n"); | 65 | DEBUGF("codec_init() error\n"); |
64 | status = CODEC_ERROR; | 66 | status = CODEC_ERROR; |
65 | goto exit; | 67 | goto exit; |
66 | } | 68 | } |
67 | 69 | ||
68 | while (!*ci->taginfo_ready && !ci->stop_codec) | 70 | if (codec_wait_taginfo() != 0) |
69 | ci->sleep(1); | 71 | goto done; |
70 | 72 | ||
71 | codec_set_replaygain(ci->id3); | 73 | codec_set_replaygain(ci->id3); |
72 | 74 | ||
@@ -189,7 +191,6 @@ next_track: | |||
189 | endofstream = 1; | 191 | endofstream = 1; |
190 | ci->set_elapsed(decodedsamples*1000LL/ci->id3->frequency); | 192 | ci->set_elapsed(decodedsamples*1000LL/ci->id3->frequency); |
191 | } | 193 | } |
192 | status = CODEC_OK; | ||
193 | 194 | ||
194 | done: | 195 | done: |
195 | if (ci->request_next_track()) | 196 | if (ci->request_next_track()) |