From 95db8f8022f80f906f1cc852a2debb47baff74ee Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Sun, 11 Nov 2007 20:09:13 +0000 Subject: Load the album art before the codec because find_albumart would yield to the codec, which would start requesting data before the audio handle is ready. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15584 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/apps/playback.c b/apps/playback.c index 2085549090..497f250a9c 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -2407,6 +2407,22 @@ static bool audio_load_track(int offset, bool start_play) } #endif + struct mp3entry *track_id3; + + if (track_widx == track_ridx) + track_id3 = &curtrack_id3; + else + track_id3 = bufgetid3(tracks[track_widx].id3_hid); + +#ifdef HAVE_ALBUMART + if (gui_sync_wps_uses_albumart()) + { + char aa_path[MAX_PATH]; + if (find_albumart(track_id3, aa_path, sizeof(aa_path))) + tracks[track_widx].aa_hid = bufopen(aa_path, 0, TYPE_BITMAP); + } +#endif + /* Load the codec. */ if (!audio_loadcodec(start_play)) { @@ -2427,23 +2443,6 @@ static bool audio_load_track(int offset, bool start_play) goto peek_again; } - struct mp3entry *track_id3; - - if (track_widx == track_ridx) - track_id3 = &curtrack_id3; - else - track_id3 = bufgetid3(tracks[track_widx].id3_hid); - - -#ifdef HAVE_ALBUMART - if (gui_sync_wps_uses_albumart()) - { - char aa_path[MAX_PATH]; - if (find_albumart(track_id3, aa_path, sizeof(aa_path))) - tracks[track_widx].aa_hid = bufopen(aa_path, 0, TYPE_BITMAP); - } -#endif - track_id3->elapsed = 0; enum data_type type = TYPE_PACKET_AUDIO; -- cgit v1.2.3