[vlc-commits] demux: ogg: map language to fmt desc

Francois Cartegnie git at videolan.org
Fri Mar 14 02:41:46 CET 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Mar 14 02:27:26 2014 +0100| [67bd0e7d34906953ed20c171b16f7ae38e7c720b] | committer: Francois Cartegnie

demux: ogg: map language to fmt desc

refs #4175

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

 modules/demux/xiph_metadata.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/demux/xiph_metadata.c b/modules/demux/xiph_metadata.c
index c160d9b..e4ef767 100644
--- a/modules/demux/xiph_metadata.c
+++ b/modules/demux/xiph_metadata.c
@@ -243,6 +243,14 @@ void vorbis_ParseComment( es_format_t *p_fmt, vlc_meta_t **pp_meta,
         has##var = true; \
     }
 
+#define IF_EXTRACT_FMT(txt,var,fmt,target) \
+    IF_EXTRACT(txt,var)\
+    if( fmt && !strncasecmp(psz_comment, txt, strlen(txt)) )\
+        {\
+            if ( fmt->target ) free( fmt->target );\
+            fmt->target = strdup(&psz_comment[strlen(txt)]);\
+        }
+
         IF_EXTRACT("TITLE=", Title )
         else IF_EXTRACT("ARTIST=", Artist )
         else IF_EXTRACT("GENRE=", Genre )
@@ -276,7 +284,7 @@ void vorbis_ParseComment( es_format_t *p_fmt, vlc_meta_t **pp_meta,
         else IF_EXTRACT("COMMENTS=", Description )
         else IF_EXTRACT("RATING=", Rating )
         else IF_EXTRACT("DATE=", Date )
-        else IF_EXTRACT("LANGUAGE=", Language )
+        else IF_EXTRACT_FMT("LANGUAGE=", Language, p_fmt, psz_language )
         else IF_EXTRACT("ORGANIZATION=", Publisher )
         else IF_EXTRACT("ENCODER=", EncodedBy )
         else if( !strncasecmp( psz_comment, "METADATA_BLOCK_PICTURE=", strlen("METADATA_BLOCK_PICTURE=")))



More information about the vlc-commits mailing list