Revision 029ddf33 libavformat/isom.c

View differences:

libavformat/isom.c
244 244
/* cf. QTFileFormat.pdf p253, qtff.pdf p205 */
245 245
/* http://developer.apple.com/documentation/mac/Text/Text-368.html */
246 246
/* deprecated by putting the code as 3*5bit ascii */
247
static const char * const mov_mdhd_language_map[] = {
247
static const char mov_mdhd_language_map[][4] = {
248 248
    /* 0-9 */
249 249
    "eng", "fra", "ger", "ita", "dut", "sve", "spa", "dan", "por", "nor",
250 250
    "heb", "jpn", "ara", "fin", "gre", "ice", "mlt", "tur", "hr "/*scr*/, "chi"/*ace?*/,
251
    "urd", "hin", "tha", "kor", "lit", "pol", "hun", "est", "lav",  NULL,
252
    "fo ",  NULL, "rus", "chi",  NULL, "iri", "alb", "ron", "ces", "slk",
251
    "urd", "hin", "tha", "kor", "lit", "pol", "hun", "est", "lav",    "",
252
    "fo ",    "", "rus", "chi",    "", "iri", "alb", "ron", "ces", "slk",
253 253
    "slv", "yid", "sr ", "mac", "bul", "ukr", "bel", "uzb", "kaz", "aze",
254 254
    /*?*/
255
    "aze", "arm", "geo", "mol", "kir", "tgk", "tuk", "mon",  NULL, "pus",
255
    "aze", "arm", "geo", "mol", "kir", "tgk", "tuk", "mon",    "", "pus",
256 256
    "kur", "kas", "snd", "tib", "nep", "san", "mar", "ben", "asm", "guj",
257
    "pa ", "ori", "mal", "kan", "tam", "tel",  NULL, "bur", "khm", "lao",
257
    "pa ", "ori", "mal", "kan", "tam", "tel",    "", "bur", "khm", "lao",
258 258
    /*                   roman? arabic? */
259 259
    "vie", "ind", "tgl", "may", "may", "amh", "tir", "orm", "som", "swa",
260 260
    /*==rundi?*/
261
    NULL, "run",  NULL, "mlg", "epo",  NULL,  NULL,  NULL,  NULL,  NULL,
261
       "", "run",    "", "mlg", "epo",    "",    "",    "",    "",    "",
262 262
    /* 100 */
263
    NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,
264
    NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,
265
    NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL,  NULL, "wel", "baq",
263
       "",    "",    "",    "",    "",    "",    "",    "",    "",    "",
264
       "",    "",    "",    "",    "",    "",    "",    "",    "",    "",
265
       "",    "",    "",    "",    "",    "",    "",    "", "wel", "baq",
266 266
    "cat", "lat", "que", "grn", "aym", "tat", "uig", "dzo", "jav"
267 267
};
268 268

  
......
271 271
    int i, code = 0;
272 272

  
273 273
    /* old way, only for QT? */
274
    for (i = 0; !mp4 && i < FF_ARRAY_ELEMS(mov_mdhd_language_map); i++) {
275
        if (mov_mdhd_language_map[i] && !strcmp(lang, mov_mdhd_language_map[i]))
274
    for (i = 0; lang[0] && !mp4 && i < FF_ARRAY_ELEMS(mov_mdhd_language_map); i++) {
275
        if (!strcmp(lang, mov_mdhd_language_map[i]))
276 276
            return i;
277 277
    }
278 278
    /* XXX:can we do that in mov too? */
......
309 309
    /* old fashion apple lang code */
310 310
    if (code >= FF_ARRAY_ELEMS(mov_mdhd_language_map))
311 311
        return 0;
312
    if (!mov_mdhd_language_map[code])
312
    if (!mov_mdhd_language_map[code][0])
313 313
        return 0;
314
    strncpy(to, mov_mdhd_language_map[code], 4);
314
    memcpy(to, mov_mdhd_language_map[code], 4);
315 315
    return 1;
316 316
}

Also available in: Unified diff