summaryrefslogtreecommitdiff
path: root/lib/rbcodec/metadata/id3tags.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/metadata/id3tags.c')
-rw-r--r--lib/rbcodec/metadata/id3tags.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/lib/rbcodec/metadata/id3tags.c b/lib/rbcodec/metadata/id3tags.c
index 84b3c593ef..c3a0473e7e 100644
--- a/lib/rbcodec/metadata/id3tags.c
+++ b/lib/rbcodec/metadata/id3tags.c
@@ -43,9 +43,7 @@
43 43
44#include "metadata.h" 44#include "metadata.h"
45#include "mp3data.h" 45#include "mp3data.h"
46#if CONFIG_CODEC == SWCODEC
47#include "metadata_common.h" 46#include "metadata_common.h"
48#endif
49#include "metadata_parsers.h" 47#include "metadata_parsers.h"
50#include "misc.h" 48#include "misc.h"
51 49
@@ -91,9 +89,6 @@ static const char* const genres[] = {
91 "Synthpop" 89 "Synthpop"
92}; 90};
93 91
94#if CONFIG_CODEC != SWCODEC
95static
96#endif
97char* id3_get_num_genre(unsigned int genre_num) 92char* id3_get_num_genre(unsigned int genre_num)
98{ 93{
99 if (genre_num < ARRAYLEN(genres)) 94 if (genre_num < ARRAYLEN(genres))
@@ -376,23 +371,20 @@ static int parseuser( struct mp3entry* entry, char* tag, int bufferpos )
376 /* At least part of the value was read, so we can safely try to 371 /* At least part of the value was read, so we can safely try to
377 * parse it */ 372 * parse it */
378 value = tag + desc_len + 1; 373 value = tag + desc_len + 1;
379 374
380 if (!strcasecmp(tag, "ALBUM ARTIST")) { 375 if (!strcasecmp(tag, "ALBUM ARTIST")) {
381 length = strlen(value) + 1; 376 length = strlen(value) + 1;
382 strlcpy(tag, value, length); 377 strlcpy(tag, value, length);
383 entry->albumartist = tag; 378 entry->albumartist = tag;
384#if CONFIG_CODEC == SWCODEC
385 } else { 379 } else {
386 /* Call parse_replaygain(). */ 380 /* Call parse_replaygain(). */
387 parse_replaygain(tag, value, entry); 381 parse_replaygain(tag, value, entry);
388#endif
389 } 382 }
390 } 383 }
391 384
392 return tag - entry->id3v2buf + length; 385 return tag - entry->id3v2buf + length;
393} 386}
394 387
395#if CONFIG_CODEC == SWCODEC
396/* parse RVA2 binary data and convert to replaygain information. */ 388/* parse RVA2 binary data and convert to replaygain information. */
397static int parserva2( struct mp3entry* entry, char* tag, int bufferpos) 389static int parserva2( struct mp3entry* entry, char* tag, int bufferpos)
398{ 390{
@@ -452,13 +444,12 @@ static int parserva2( struct mp3entry* entry, char* tag, int bufferpos)
452 return start_pos; 444 return start_pos;
453 } 445 }
454 } 446 }
455 447
456 parse_replaygain_int(album, gain, peak * 2, entry); 448 parse_replaygain_int(album, gain, peak * 2, entry);
457 } 449 }
458 450
459 return start_pos; 451 return start_pos;
460} 452}
461#endif
462 453
463static int parsembtid( struct mp3entry* entry, char* tag, int bufferpos ) 454static int parsembtid( struct mp3entry* entry, char* tag, int bufferpos )
464{ 455{
@@ -514,9 +505,7 @@ static const struct tag_resolver taglist[] = {
514 { "PIC", 3, 0, &parsealbumart, true }, 505 { "PIC", 3, 0, &parsealbumart, true },
515#endif 506#endif
516 { "TXXX", 4, 0, &parseuser, false }, 507 { "TXXX", 4, 0, &parseuser, false },
517#if CONFIG_CODEC == SWCODEC
518 { "RVA2", 4, 0, &parserva2, true }, 508 { "RVA2", 4, 0, &parserva2, true },
519#endif
520 { "UFID", 4, 0, &parsembtid, false }, 509 { "UFID", 4, 0, &parsembtid, false },
521}; 510};
522 511
@@ -738,9 +727,7 @@ void setid3v2title(int fd, struct mp3entry *entry)
738 bool unsynch = false; 727 bool unsynch = false;
739 int i, j; 728 int i, j;
740 int rc; 729 int rc;
741#if CONFIG_CODEC == SWCODEC
742 bool itunes_gapless = false; 730 bool itunes_gapless = false;
743#endif
744 731
745#ifdef HAVE_ALBUMART 732#ifdef HAVE_ALBUMART
746 entry->has_embedded_albumart = false; 733 entry->has_embedded_albumart = false;
@@ -984,14 +971,11 @@ void setid3v2title(int fd, struct mp3entry *entry)
984 (tr->tag_length == 3 && !memcmp( header, "COM", 3))) { 971 (tr->tag_length == 3 && !memcmp( header, "COM", 3))) {
985 int offset; 972 int offset;
986 if(bytesread >= 8 && !strncmp(tag+4, "iTun", 4)) { 973 if(bytesread >= 8 && !strncmp(tag+4, "iTun", 4)) {
987#if CONFIG_CODEC == SWCODEC
988 /* check for iTunes gapless information */ 974 /* check for iTunes gapless information */
989 if(bytesread >= 12 && !strncmp(tag+4, "iTunSMPB", 8)) 975 if(bytesread >= 12 && !strncmp(tag+4, "iTunSMPB", 8))
990 itunes_gapless = true; 976 itunes_gapless = true;
991 else 977 else
992#endif 978 break; /* ignore other with iTunes tags */
993 /* ignore other with iTunes tags */
994 break;
995 } 979 }
996 980
997 offset = 3 + unicode_len(*tag, tag + 4); 981 offset = 3 + unicode_len(*tag, tag + 4);
@@ -1071,7 +1055,6 @@ void setid3v2title(int fd, struct mp3entry *entry)
1071 tag[bytesread] = 0; 1055 tag[bytesread] = 0;
1072 bufferpos += bytesread + 1; 1056 bufferpos += bytesread + 1;
1073 1057
1074#if CONFIG_CODEC == SWCODEC
1075 /* parse the tag if it contains iTunes gapless info */ 1058 /* parse the tag if it contains iTunes gapless info */
1076 if (itunes_gapless) 1059 if (itunes_gapless)
1077 { 1060 {
@@ -1079,7 +1062,6 @@ void setid3v2title(int fd, struct mp3entry *entry)
1079 entry->lead_trim = get_itunes_int32(tag, 1); 1062 entry->lead_trim = get_itunes_int32(tag, 1);
1080 entry->tail_trim = get_itunes_int32(tag, 2); 1063 entry->tail_trim = get_itunes_int32(tag, 2);
1081 } 1064 }
1082#endif
1083 1065
1084 /* Note that parser functions sometimes set *ptag to NULL, so 1066 /* Note that parser functions sometimes set *ptag to NULL, so
1085 * the "!*ptag" check here doesn't always have the desired 1067 * the "!*ptag" check here doesn't always have the desired