From 0922eb823e75717188d9a317dacf8ba8f5a49204 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Thu, 2 Jan 2020 15:43:08 +0000 Subject: ffmpeg: added 'album artist' and 'composer' tags support (#1028) git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9175 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp') diff --git a/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp b/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp index 53beb5ba1..3a0f112c9 100644 --- a/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp +++ b/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp @@ -172,9 +172,11 @@ bool DecoderFFmpeg::initialize() AVDictionaryEntry *album = av_dict_get(ic->metadata,"album",nullptr,0); if(!album) album = av_dict_get(ic->metadata,"WM/AlbumTitle",nullptr,0); + AVDictionaryEntry *album_artist = av_dict_get(ic->metadata,"album_artist",nullptr,0); AVDictionaryEntry *artist = av_dict_get(ic->metadata,"artist",nullptr,0); if(!artist) artist = av_dict_get(ic->metadata,"author",nullptr,0); + AVDictionaryEntry *composer = av_dict_get(ic->metadata,"composer",nullptr,0); AVDictionaryEntry *comment = av_dict_get(ic->metadata,"comment",nullptr,0); AVDictionaryEntry *genre = av_dict_get(ic->metadata,"genre",nullptr,0); AVDictionaryEntry *title = av_dict_get(ic->metadata,"title",nullptr,0); @@ -189,10 +191,15 @@ bool DecoderFFmpeg::initialize() if(!track) track = av_dict_get(ic->metadata,"WM/TrackNumber",nullptr,0); + if(album) metaData.insert(Qmmp::ALBUM, QString::fromUtf8(album->value).trimmed()); + if(album_artist) + metaData.insert(Qmmp::ALBUMARTIST, QString::fromUtf8(album_artist->value).trimmed()); if(artist) metaData.insert(Qmmp::ARTIST, QString::fromUtf8(artist->value).trimmed()); + if(composer) + metaData.insert(Qmmp::COMPOSER, QString::fromUtf8(composer->value).trimmed()); if(comment) metaData.insert(Qmmp::COMMENT, QString::fromUtf8(comment->value).trimmed()); if(genre) -- cgit v1.2.3-13-gbd6f