aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/isom.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2010-01-30 22:05:26 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2010-01-30 22:05:26 +0000
commit029ddf333c8f36ddc65c91cb6f18ae310d2bd1ab (patch)
treea71dde930dc4a8e51f00f26acc9f1af76299a250 /libavformat/isom.c
parent909f659473f51306e3b8f0251239ea07f88c9023 (diff)
downloadffmpeg-029ddf333c8f36ddc65c91cb6f18ae310d2bd1ab.tar.gz
Store strings directly in mov_mdhd_language_map instead of using pointers,
which has a up to 200% overhead. Also allows to use memcpy instead of strcpy. Originally committed as revision 21560 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/isom.c')
-rw-r--r--libavformat/isom.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/libavformat/isom.c b/libavformat/isom.c
index 62daed08af..a6e67e2267 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -244,25 +244,25 @@ const AVCodecTag ff_codec_movsubtitle_tags[] = {
/* cf. QTFileFormat.pdf p253, qtff.pdf p205 */
/* http://developer.apple.com/documentation/mac/Text/Text-368.html */
/* deprecated by putting the code as 3*5bit ascii */
-static const char * const mov_mdhd_language_map[] = {
+static const char mov_mdhd_language_map[][4] = {
/* 0-9 */
"eng", "fra", "ger", "ita", "dut", "sve", "spa", "dan", "por", "nor",
"heb", "jpn", "ara", "fin", "gre", "ice", "mlt", "tur", "hr "/*scr*/, "chi"/*ace?*/,
- "urd", "hin", "tha", "kor", "lit", "pol", "hun", "est", "lav", NULL,
- "fo ", NULL, "rus", "chi", NULL, "iri", "alb", "ron", "ces", "slk",
+ "urd", "hin", "tha", "kor", "lit", "pol", "hun", "est", "lav", "",
+ "fo ", "", "rus", "chi", "", "iri", "alb", "ron", "ces", "slk",
"slv", "yid", "sr ", "mac", "bul", "ukr", "bel", "uzb", "kaz", "aze",
/*?*/
- "aze", "arm", "geo", "mol", "kir", "tgk", "tuk", "mon", NULL, "pus",
+ "aze", "arm", "geo", "mol", "kir", "tgk", "tuk", "mon", "", "pus",
"kur", "kas", "snd", "tib", "nep", "san", "mar", "ben", "asm", "guj",
- "pa ", "ori", "mal", "kan", "tam", "tel", NULL, "bur", "khm", "lao",
+ "pa ", "ori", "mal", "kan", "tam", "tel", "", "bur", "khm", "lao",
/* roman? arabic? */
"vie", "ind", "tgl", "may", "may", "amh", "tir", "orm", "som", "swa",
/*==rundi?*/
- NULL, "run", NULL, "mlg", "epo", NULL, NULL, NULL, NULL, NULL,
+ "", "run", "", "mlg", "epo", "", "", "", "", "",
/* 100 */
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "wel", "baq",
+ "", "", "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "", "wel", "baq",
"cat", "lat", "que", "grn", "aym", "tat", "uig", "dzo", "jav"
};
@@ -271,8 +271,8 @@ int ff_mov_iso639_to_lang(const char lang[4], int mp4)
int i, code = 0;
/* old way, only for QT? */
- for (i = 0; !mp4 && i < FF_ARRAY_ELEMS(mov_mdhd_language_map); i++) {
- if (mov_mdhd_language_map[i] && !strcmp(lang, mov_mdhd_language_map[i]))
+ for (i = 0; lang[0] && !mp4 && i < FF_ARRAY_ELEMS(mov_mdhd_language_map); i++) {
+ if (!strcmp(lang, mov_mdhd_language_map[i]))
return i;
}
/* XXX:can we do that in mov too? */
@@ -309,8 +309,8 @@ int ff_mov_lang_to_iso639(unsigned code, char to[4])
/* old fashion apple lang code */
if (code >= FF_ARRAY_ELEMS(mov_mdhd_language_map))
return 0;
- if (!mov_mdhd_language_map[code])
+ if (!mov_mdhd_language_map[code][0])
return 0;
- strncpy(to, mov_mdhd_language_map[code], 4);
+ memcpy(to, mov_mdhd_language_map[code], 4);
return 1;
}