[vlc-commits] Fixed ogg meta data parsing.

Laurent Aimar git at videolan.org
Fri Oct 7 22:26:24 CEST 2011


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Oct  7 21:15:26 2011 +0200| [96deda44de28358268775d0c03fceb32423c6cb2] | committer: Laurent Aimar

Fixed ogg meta data parsing.

It fixes #5374.

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

 modules/demux/vorbis.h |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/modules/demux/vorbis.h b/modules/demux/vorbis.h
index 21fbb35..b3d42a3 100644
--- a/modules/demux/vorbis.h
+++ b/modules/demux/vorbis.h
@@ -58,6 +58,15 @@ static inline void vorbis_ParseComment( vlc_meta_t **pp_meta, const uint8_t *p_d
     if( !p_meta )
         return;
 
+    bool hasTitle = false;
+    bool hasAlbum = false;
+    bool hasTrackNumber = false;
+    bool hasArtist = false;
+    bool hasCopyright = false;
+    bool hasDescription = false;
+    bool hasGenre = false;
+    bool hasDate = false;
+
     for( ; i_comment > 0; i_comment-- )
     {
         char *psz;
@@ -78,7 +87,7 @@ static inline void vorbis_ParseComment( vlc_meta_t **pp_meta, const uint8_t *p_d
     if( !strncasecmp(psz, txt, strlen(txt)) ) \
     { \
         const char *oldval = vlc_meta_Get( p_meta, vlc_meta_ ## var ); \
-        if( oldval ) \
+        if( oldval && has##var) \
         { \
             char * newval; \
             if( asprintf( &newval, "%s,%s", oldval, &psz[strlen(txt)] ) == -1 ) \
@@ -88,6 +97,7 @@ static inline void vorbis_ParseComment( vlc_meta_t **pp_meta, const uint8_t *p_d
         } \
         else \
             vlc_meta_Set( p_meta, vlc_meta_ ## var, &psz[strlen(txt)] ); \
+        has##var = true; \
     }
         IF_EXTRACT("TITLE=", Title )
         else IF_EXTRACT("ALBUM=", Album )



More information about the vlc-commits mailing list