metadata: Use "Album Artist" tag from AAC files.
Add Album Artist AAC metadata parsing contributed by SF user knono549. Then, change music metadata gathering code to use either Album Artist or Band as upnp:artist.
This commit is contained in:
parent
3c4c35b49c
commit
24fb139678
15
metadata.c
15
metadata.c
@ -381,7 +381,7 @@ GetAudioMetadata(const char *path, char *name)
|
|||||||
{
|
{
|
||||||
m.title = name;
|
m.title = name;
|
||||||
}
|
}
|
||||||
for( i=ROLE_START; i<N_ROLE; i++ )
|
for( i = ROLE_START; i < N_ROLE; i++ )
|
||||||
{
|
{
|
||||||
if( song.contributor[i] && *song.contributor[i] )
|
if( song.contributor[i] && *song.contributor[i] )
|
||||||
{
|
{
|
||||||
@ -400,12 +400,17 @@ GetAudioMetadata(const char *path, char *name)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* If there is a band associated with the album, use it for virtual containers. */
|
/* If there is a album artist or band associated with the album,
|
||||||
if( (i != ROLE_BAND) && (i != ROLE_ALBUMARTIST) )
|
use it for virtual containers. */
|
||||||
|
if( i < ROLE_ALBUMARTIST )
|
||||||
{
|
{
|
||||||
if( song.contributor[ROLE_BAND] && *song.contributor[ROLE_BAND] )
|
for( i = ROLE_ALBUMARTIST; i <= ROLE_BAND; i++ )
|
||||||
|
{
|
||||||
|
if( song.contributor[i] && *song.contributor[i] )
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if( i <= ROLE_BAND )
|
||||||
{
|
{
|
||||||
i = ROLE_BAND;
|
|
||||||
m.artist = trim(song.contributor[i]);
|
m.artist = trim(song.contributor[i]);
|
||||||
if( strlen(m.artist) > 48 )
|
if( strlen(m.artist) > 48 )
|
||||||
{
|
{
|
||||||
|
@ -117,6 +117,9 @@ _get_aactags(char *file, struct song_metadata *psong)
|
|||||||
psong->album = strdup((char*)¤t_data[16]);
|
psong->album = strdup((char*)¤t_data[16]);
|
||||||
else if(!memcmp(current_atom, "\xA9" "cmt", 4))
|
else if(!memcmp(current_atom, "\xA9" "cmt", 4))
|
||||||
psong->comment = strdup((char*)¤t_data[16]);
|
psong->comment = strdup((char*)¤t_data[16]);
|
||||||
|
else if(!memcmp(current_atom, "aART", 4) ||
|
||||||
|
!memcmp(current_atom, "aart", 4))
|
||||||
|
psong->contributor[ROLE_ALBUMARTIST] = strdup((char*)¤t_data[16]);
|
||||||
else if(!memcmp(current_atom, "\xA9" "dir", 4))
|
else if(!memcmp(current_atom, "\xA9" "dir", 4))
|
||||||
psong->contributor[ROLE_CONDUCTOR] = strdup((char*)¤t_data[16]);
|
psong->contributor[ROLE_CONDUCTOR] = strdup((char*)¤t_data[16]);
|
||||||
else if(!memcmp(current_atom, "\xA9" "wrt", 4))
|
else if(!memcmp(current_atom, "\xA9" "wrt", 4))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user