[vlc-commits] ASF: add extrametadata

Jean-Baptiste Kempf git at videolan.org
Mon May 23 18:48:25 CEST 2016


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon May 23 18:42:57 2016 +0200| [fb0cd02d18d5cfd1d64b98a17e181cf07dea67bf] | committer: Jean-Baptiste Kempf

ASF: add extrametadata

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

 modules/demux/asf/asf.c |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index 2e123ea..d303e2e 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -1209,13 +1209,18 @@ static int DemuxInit( demux_t *p_demux )
             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 );
+            set_meta( "WM/AlbumTitle",   vlc_meta_Album )
+            else set_meta( "WM/TrackNumber",  vlc_meta_TrackNumber )
+            else set_meta( "WM/Year",         vlc_meta_Date )
+            else set_meta( "WM/Genre",        vlc_meta_Genre )
+            else set_meta( "WM/Genre",        vlc_meta_Genre )
+            else set_meta( "WM/AlbumArtist",  vlc_meta_Artist )
+            else set_meta( "WM/Publisher",    vlc_meta_Publisher )
+            else if( p_ecd->ppsz_value[i] != NULL &&
+                    *p_ecd->ppsz_value[i] != '\0' && /* no empty value */
+                    *p_ecd->ppsz_value[i] != '{'  && /* no guid value */
+                    *p_ecd->ppsz_name[i] != '{' )    /* no guid name */
+                    vlc_meta_AddExtra( p_sys->meta, p_ecd->ppsz_name[i], p_ecd->ppsz_value[i] );
             /* TODO map WM/Composer, WM/Provider, WM/PartOfSet, PeakValue, AverageLevel  */
 #undef set_meta
         }



More information about the vlc-commits mailing list