mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
Album Art: Eliminate redundant check
When the 'Album Art' setting was set to 'Prefer Image File' and neither image file nor embedded artwork were found, playback would check for files twice. Change-Id: Ibe392928d58ec04103e2572124841724509bd859
This commit is contained in:
parent
b02123d349
commit
4d7327b04d
1 changed files with 8 additions and 4 deletions
|
@ -1710,6 +1710,7 @@ static int audio_load_albumart(struct track_info *infop,
|
||||||
struct bufopen_bitmap_data user_data;
|
struct bufopen_bitmap_data user_data;
|
||||||
int *aa_hid = &infop->aa_hid[i];
|
int *aa_hid = &infop->aa_hid[i];
|
||||||
int hid = ERR_UNSUPPORTED_TYPE;
|
int hid = ERR_UNSUPPORTED_TYPE;
|
||||||
|
bool checked_image_file = false;
|
||||||
|
|
||||||
/* albumart_slots may change during a yield of bufopen,
|
/* albumart_slots may change during a yield of bufopen,
|
||||||
* but that's no problem */
|
* but that's no problem */
|
||||||
|
@ -1721,12 +1722,15 @@ static int audio_load_albumart(struct track_info *infop,
|
||||||
user_data.dim = &albumart_slots[i].dim;
|
user_data.dim = &albumart_slots[i].dim;
|
||||||
|
|
||||||
char path[MAX_PATH];
|
char path[MAX_PATH];
|
||||||
if(global_settings.album_art == AA_PREFER_IMAGE_FILE &&
|
if(global_settings.album_art == AA_PREFER_IMAGE_FILE)
|
||||||
find_albumart(track_id3, path, sizeof(path),
|
|
||||||
&albumart_slots[i].dim))
|
|
||||||
{
|
{
|
||||||
|
if (find_albumart(track_id3, path, sizeof(path),
|
||||||
|
&albumart_slots[i].dim))
|
||||||
|
{
|
||||||
user_data.embedded_albumart = NULL;
|
user_data.embedded_albumart = NULL;
|
||||||
hid = bufopen(path, 0, TYPE_BITMAP, &user_data);
|
hid = bufopen(path, 0, TYPE_BITMAP, &user_data);
|
||||||
|
}
|
||||||
|
checked_image_file = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We can only decode jpeg for embedded AA */
|
/* We can only decode jpeg for embedded AA */
|
||||||
|
@ -1738,7 +1742,7 @@ static int audio_load_albumart(struct track_info *infop,
|
||||||
hid = bufopen(track_id3->path, 0, TYPE_BITMAP, &user_data);
|
hid = bufopen(track_id3->path, 0, TYPE_BITMAP, &user_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (global_settings.album_art != AA_OFF &&
|
if (global_settings.album_art != AA_OFF && !checked_image_file &&
|
||||||
hid < 0 && hid != ERR_BUFFER_FULL)
|
hid < 0 && hid != ERR_BUFFER_FULL)
|
||||||
{
|
{
|
||||||
/* No embedded AA or it couldn't be loaded - try other sources */
|
/* No embedded AA or it couldn't be loaded - try other sources */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue