changeset 5611:1338a4972dd4 libavformat

Always consider the mov language code as 4 bytes fixed size and change the function declaration to reflect this.
author reimar
date Sat, 30 Jan 2010 21:54:06 +0000
parents eaae42073860
children 4f20f4db87f7
files isom.c isom.h
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/isom.c	Sat Jan 30 21:50:47 2010 +0000
+++ b/isom.c	Sat Jan 30 21:54:06 2010 +0000
@@ -266,7 +266,7 @@
     "cat", "lat", "que", "grn", "aym", "tat", "uig", "dzo", "jav"
 };
 
-int ff_mov_iso639_to_lang(const char *lang, int mp4)
+int ff_mov_iso639_to_lang(const char lang[4], int mp4)
 {
     int i, code = 0;
 
@@ -293,9 +293,10 @@
     return code;
 }
 
-int ff_mov_lang_to_iso639(unsigned code, char *to)
+int ff_mov_lang_to_iso639(unsigned code, char to[4])
 {
     int i;
+    memset(to, 0, 4);
     /* is it the mangled iso code? */
     /* see http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt */
     if (code > 138) {
--- a/isom.h	Sat Jan 30 21:50:47 2010 +0000
+++ b/isom.h	Sat Jan 30 21:54:06 2010 +0000
@@ -34,8 +34,8 @@
 extern const AVCodecTag codec_movaudio_tags[];
 extern const AVCodecTag ff_codec_movsubtitle_tags[];
 
-int ff_mov_iso639_to_lang(const char *lang, int mp4);
-int ff_mov_lang_to_iso639(unsigned code, char *to);
+int ff_mov_iso639_to_lang(const char lang[4], int mp4);
+int ff_mov_lang_to_iso639(unsigned code, char to[4]);
 
 /* the QuickTime file format is quite convoluted...
  * it has lots of index tables, each indexing something in another one...