in some formats, e.g. vorbis, the metadata is stored per-stream.
---
 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 b46f466..68c3762 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);
-- 
1.7.1


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Musicpd-dev-team mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team

Reply via email to