diff options
author | Anton Khirnov <wyskas@gmail.com> | 2010-07-10 13:14:24 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2010-07-12 11:36:55 +0200 |
commit | 0fc0196dba684e1aac2752a64babffad62f84356 (patch) | |
tree | 8a6b02be3ecfb36e30cf69aa85d01da9c9336b1b | |
parent | 1492324c76900a4da25eb766558283311d39e399 (diff) | |
download | mpd-0fc0196dba684e1aac2752a64babffad62f84356.tar.gz mpd-0fc0196dba684e1aac2752a64babffad62f84356.tar.xz mpd-0fc0196dba684e1aac2752a64babffad62f84356.zip |
ffmpeg: read the audio stream metadata in addition to global
in some formats, e.g. vorbis, the metadata is stored per-stream.
-rw-r--r-- | src/decoder/ffmpeg_decoder_plugin.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c index b46f466eb..68c376211 100644 --- a/src/decoder/ffmpeg_decoder_plugin.c +++ b/src/decoder/ffmpeg_decoder_plugin.c @@ -452,8 +452,12 @@ ffmpeg_stream_tag(struct input_stream *is) #if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0) av_metadata_conv(f, NULL, f->iformat->metadata_conv); - for (unsigned i = 0; i < sizeof(ffmpeg_tag_maps)/sizeof(ffmpeg_tag_map); i++) + for (unsigned i = 0; i < sizeof(ffmpeg_tag_maps)/sizeof(ffmpeg_tag_map); i++) { + int idx = ffmpeg_find_audio_stream(f); ffmpeg_copy_metadata(tag, f->metadata, ffmpeg_tag_maps[i]); + if (idx >= 0) + ffmpeg_copy_metadata(tag, f->streams[idx]->metadata, ffmpeg_tag_maps[i]); + } #else if (f->author[0]) tag_add_item(tag, TAG_ARTIST, f->author); |