[vlc-commits] demux wmv: support metadata from the extended content description

Jean-Baptiste Kempf git at videolan.org
Fri May 20 18:54:35 CEST 2016


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri May 20 18:53:07 2016 +0200| [d67d46926f577f3bb2e5912b709a9fcaa4b27fd9] | committer: Jean-Baptiste Kempf

demux wmv: support metadata from the extended content description

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d67d46926f577f3bb2e5912b709a9fcaa4b27fd9
---

 modules/demux/asf/asf.c |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index d059d71..2e123ea 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -1198,6 +1198,29 @@ static int DemuxInit( demux_t *p_demux )
             vlc_meta_SetRating( p_sys->meta, p_cd->psz_rating );
         }
     }
+    asf_object_extended_content_description_t *p_ecd;
+    if( ( p_ecd = ASF_FindObject( p_sys->p_root->p_hdr,
+                                 &asf_object_extended_content_description, 0 ) ) )
+    {
+        for( int i = 0; i < p_ecd->i_count; i++ )
+        {
+
+#define set_meta( name, vlc_type ) \
+            if( !strncmp( p_ecd->ppsz_name[i], name, strlen(name) ) ) \
+                vlc_meta_Set( p_sys->meta, vlc_type, p_ecd->ppsz_value[i] );
+
+            set_meta( "WM/AlbumTitle",   vlc_meta_Album );
+            set_meta( "WM/TrackNumber",  vlc_meta_TrackNumber );
+            set_meta( "WM/Year",         vlc_meta_Date );
+            set_meta( "WM/Genre",        vlc_meta_Genre );
+            set_meta( "WM/Genre",        vlc_meta_Genre );
+            set_meta( "WM/AlbumArtist",  vlc_meta_Artist );
+            set_meta( "WM/Publisher",    vlc_meta_Publisher );
+            /* TODO map WM/Composer, WM/Provider, WM/PartOfSet, PeakValue, AverageLevel  */
+#undef set_meta
+        }
+    }
+
     /// \tood Fix Child meta for ASF tracks
 #if 0
     for( i_stream = 0, i = 0; i < MAX_ASF_TRACKS; i++ )



More information about the vlc-commits mailing list