1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-30 15:39:27 +02:00

Bug 2564 - Metadata: Artist and Year tags missing on M4A(AAC) exports

This commit is contained in:
Leland Lucius 2021-01-27 02:34:06 -06:00
parent aa89805fd2
commit 058023f978
2 changed files with 23 additions and 5 deletions

View File

@ -1079,14 +1079,24 @@ bool ExportFFmpeg::AddTags(const Tags *tags)
return false;
}
SetMetadata(tags, "author", TAG_ARTIST);
SetMetadata(tags, "album", TAG_ALBUM);
SetMetadata(tags, "comment", TAG_COMMENTS);
SetMetadata(tags, "genre", TAG_GENRE);
SetMetadata(tags, "title", TAG_TITLE);
SetMetadata(tags, "year", TAG_YEAR);
SetMetadata(tags, "track", TAG_TRACK);
// Bug 2564: Add m4a tags
if (mEncFormatDesc->audio_codec == AV_CODEC_ID_AAC)
{
SetMetadata(tags, "artist", TAG_ARTIST);
SetMetadata(tags, "date", TAG_YEAR);
}
else
{
SetMetadata(tags, "author", TAG_ARTIST);
SetMetadata(tags, "year", TAG_YEAR);
}
return true;
}

View File

@ -733,13 +733,21 @@ void FFmpegImportFileHandle::WriteMetadata(Tags *tags)
tags->Clear();
GetMetadata(tags, TAG_TITLE, "title");
GetMetadata(tags, TAG_ARTIST, "author");
// GetMetadata(tags, TAG_COPYRIGHT, "copyright");
GetMetadata(tags, TAG_COMMENTS, "comment");
GetMetadata(tags, TAG_ALBUM, "album");
GetMetadata(tags, TAG_YEAR, "year");
GetMetadata(tags, TAG_TRACK, "track");
GetMetadata(tags, TAG_GENRE, "genre");
if (wxString(mFormatContext->iformat->name).Contains("m4a"))
{
GetMetadata(tags, TAG_ARTIST, "artist");
GetMetadata(tags, TAG_YEAR, "date");
}
else
{
GetMetadata(tags, TAG_ARTIST, "author");
GetMetadata(tags, TAG_YEAR, "year");
}
}
void FFmpegImportFileHandle::GetMetadata(Tags *tags, const wxChar *tag, const char *name)