changeset 5791:9cde0ca98839 libavformat

Correctly mark mov metadata as utf-8, using iso language code
author bcoudurier
date Tue, 09 Mar 2010 01:21:09 +0000
parents dba191dda275
children 2fb291f12e5f
files movenc.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/movenc.c	Tue Mar 09 01:03:42 2010 +0000
+++ b/movenc.c	Tue Mar 09 01:21:09 2010 +0000
@@ -1390,11 +1390,13 @@
     while ((t2 = av_metadata_get(s->metadata, tag2, t2, AV_METADATA_IGNORE_SUFFIX))) {
         len2 = strlen(t2->key);
         if (len2 == len+4 && !strcmp(t->value, t2->value)
-            && (l=ff_mov_iso639_to_lang(&t2->key[len2-3], 0)) >= 0) {
+            && (l=ff_mov_iso639_to_lang(&t2->key[len2-3], 1)) >= 0) {
             lang = l;
             break;
         }
     }
+    if (!lang)
+        lang = ff_mov_iso639_to_lang("und", 1);
     return mov_write_string_tag(pb, name, t->value, lang, long_style);
 }