summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2013-06-15 20:56:13 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2013-06-15 21:04:13 +0200
commitb6ddbc41a51ef066063378ca1101b7f105f7cc6f (patch)
tree13b1aee177b8d145152c11a38c4f4265f41e9d64
parent084c75e5f9c5d7de14c20e4bb6330745fbd02a46 (diff)
downloadrockbox-b6ddbc41a51ef066063378ca1101b7f105f7cc6f.tar.gz
rockbox-b6ddbc41a51ef066063378ca1101b7f105f7cc6f.zip
Fix id3v2 album art if more than one image is present.
Rockbox only uses the first album art image (APIC / PIC frame) found in id3v2 tags. When a file contains more than one image the second one is ignored but the parsealbumart() callback overwrites the already set data. This causes the metadata structure to contain an invalid pointer to the image data, resulting in no image shown. Make parsealbumart() aware of this and skip parsing when an albumart image has already been found. Fixes FS#12870. Change-Id: Id8164f319cd5e1ee868b581f8f4ad3ea69c17f77
-rw-r--r--lib/rbcodec/metadata/id3tags.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/rbcodec/metadata/id3tags.c b/lib/rbcodec/metadata/id3tags.c
index e7fed7c868..fed99d81a0 100644
--- a/lib/rbcodec/metadata/id3tags.c
+++ b/lib/rbcodec/metadata/id3tags.c
@@ -299,7 +299,10 @@ static int parsegenre( struct mp3entry* entry, char* tag, int bufferpos )
299/* parse embed albumart */ 299/* parse embed albumart */
300static int parsealbumart( struct mp3entry* entry, char* tag, int bufferpos ) 300static int parsealbumart( struct mp3entry* entry, char* tag, int bufferpos )
301{ 301{
302 entry->has_embedded_albumart = false; 302 /* don't parse albumart if already one found. This callback function is
303 * called unconditionally. */
304 if(entry->has_embedded_albumart)
305 return bufferpos;
303 306
304 /* we currently don't support unsynchronizing albumart */ 307 /* we currently don't support unsynchronizing albumart */
305 if (entry->albumart.type == AA_TYPE_UNSYNC) 308 if (entry->albumart.type == AA_TYPE_UNSYNC)
@@ -735,6 +738,10 @@ void setid3v2title(int fd, struct mp3entry *entry)
735 bool itunes_gapless = false; 738 bool itunes_gapless = false;
736#endif 739#endif
737 740
741#ifdef HAVE_ALBUMART
742 entry->has_embedded_albumart = false;
743#endif
744
738 global_ff_found = false; 745 global_ff_found = false;
739 746
740 /* Bail out if the tag is shorter than 10 bytes */ 747 /* Bail out if the tag is shorter than 10 bytes */