summaryrefslogtreecommitdiff
path: root/apps/codecs/wmapro.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-02-20 15:27:10 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-02-20 15:27:10 +0000
commit85e40257dc65e3542b785898ddf60482e2d1ab0c (patch)
treef7bf9b33decce4296fbea0f437252f40aba6d5de /apps/codecs/wmapro.c
parent460d54977ae2f9c2c5997c6c4cd5541ab436d718 (diff)
downloadrockbox-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/wmapro.c')
-rw-r--r--apps/codecs/wmapro.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/codecs/wmapro.c b/apps/codecs/wmapro.c
index 75bbd24cda..c02dddeeb3 100644
--- a/apps/codecs/wmapro.c
+++ b/apps/codecs/wmapro.c
@@ -48,16 +48,18 @@ enum codec_status codec_main(void)
48 48
49 49
50next_track: 50next_track:
51 retval = CODEC_OK;
51 52
52 /* Wait for the metadata to be read */ 53 /* Wait for the metadata to be read */
53 while (!*ci->taginfo_ready && !ci->stop_codec) 54 if (codec_wait_taginfo() != 0)
54 ci->sleep(1); 55 goto done;
55
56 retval = CODEC_OK;
57 56
58 /* Remember the resume position */ 57 /* Remember the resume position */
59 resume_offset = ci->id3->offset; 58 resume_offset = ci->id3->offset;
60 restart_track: 59
60restart_track:
61 retval = CODEC_OK;
62
61 if (codec_init()) { 63 if (codec_init()) {
62 LOGF("(WMA PRO) Error: Error initialising codec\n"); 64 LOGF("(WMA PRO) Error: Error initialising codec\n");
63 retval = CODEC_ERROR; 65 retval = CODEC_ERROR;
@@ -149,7 +151,6 @@ next_track:
149 /* Advance to the next logical packet */ 151 /* Advance to the next logical packet */
150 ci->advance_buffer(packetlength); 152 ci->advance_buffer(packetlength);
151 } 153 }
152 retval = CODEC_OK;
153 154
154done: 155done:
155 if (ci->request_next_track()) 156 if (ci->request_next_track())