aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-10-28 22:12:22 +0100
committerMax Kellermann <max@duempel.org>2009-10-28 22:12:22 +0100
commit04816a6369b3a5277dfcb4cc7dbbe66881a2a7e9 (patch)
treebd24ca2f52940d35140440f87b013532217058ba
parentd083032236dc05f00a9bfab201537083f7bb10b4 (diff)
downloadmpd-04816a6369b3a5277dfcb4cc7dbbe66881a2a7e9.tar.gz
mpd-04816a6369b3a5277dfcb4cc7dbbe66881a2a7e9.tar.xz
mpd-04816a6369b3a5277dfcb4cc7dbbe66881a2a7e9.zip
decoder/ffmpeg: convert metadata
Convert the metadata with the libavformat function av_metadata_conv(). This ensures that canonical tag names are provided by libavformat, and we can remove the "artist" vs "author" workaround.
-rw-r--r--NEWS2
-rw-r--r--src/decoder/ffmpeg_plugin.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index bc2b7f9c0..4969dc91b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
ver 0.15.6 (2009/??/??)
+* decoders:
+ - ffmpeg: convert metadata
* output_thread: check again if output is open on PAUSE
* update: delete ignored symlinks from database
diff --git a/src/decoder/ffmpeg_plugin.c b/src/decoder/ffmpeg_plugin.c
index 27b0c2507..2f7ed6d1f 100644
--- a/src/decoder/ffmpeg_plugin.c
+++ b/src/decoder/ffmpeg_plugin.c
@@ -352,17 +352,17 @@ ffmpeg_copy_metadata(struct tag *tag, AVMetadata *m,
static bool ffmpeg_tag_internal(struct ffmpeg_context *ctx)
{
struct tag *tag = (struct tag *) ctx->tag;
- const AVFormatContext *f = ctx->format_context;
+ AVFormatContext *f = ctx->format_context;
tag->time = 0;
if (f->duration != (int64_t)AV_NOPTS_VALUE)
tag->time = f->duration / AV_TIME_BASE;
#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0)
+ av_metadata_conv(f, NULL, f->iformat->metadata_conv);
+
ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_TITLE, "title");
- if (!ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_ARTIST, "author"))
- ffmpeg_copy_metadata(tag, f->metadata,
- TAG_ITEM_ARTIST, "artist");
+ ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_ARTIST, "author");
ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_ALBUM, "album");
ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_COMMENT, "comment");
ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_GENRE, "genre");