Browse Source

movdec: handle 0x7fff langcode as macintosh per the specs

The correct point that seperates ISO and MAC language codes is 0x400
according to the current QT spec. Old QT specs did not list where this
seperation is but apparently only defined the meaning of the first 137.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.11
Baptiste Coudurier Michael Niedermayer 13 years ago
parent
commit
e636aa1a56
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      libavformat/isom.c
  2. +1
    -1
      libavformat/mov.c

+ 1
- 1
libavformat/isom.c View File

@@ -348,7 +348,7 @@ int ff_mov_lang_to_iso639(unsigned code, char to[4])
memset(to, 0, 4); memset(to, 0, 4);
/* is it the mangled iso code? */ /* is it the mangled iso code? */
/* see http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt */ /* see http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt */
if (code > 138) {
if (code >= 0x400 && code != 0x7fff) {
for (i = 2; i >= 0; i--) { for (i = 2; i >= 0; i--) {
to[i] = 0x60 + (code & 0x1f); to[i] = 0x60 + (code & 0x1f);
code >>= 5; code >>= 5;


+ 1
- 1
libavformat/mov.c View File

@@ -253,7 +253,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (parse) if (parse)
parse(c, pb, str_size, key); parse(c, pb, str_size, key);
else { else {
if (data_type == 3 || (data_type == 0 && langcode < 0x800)) { // MAC Encoded
if (data_type == 3 || (data_type == 0 && (langcode < 0x400 || langcode == 0x7fff))) { // MAC Encoded
mov_read_mac_string(c, pb, str_size, str, sizeof(str)); mov_read_mac_string(c, pb, str_size, str, sizeof(str));
} else { } else {
avio_read(pb, str, str_size); avio_read(pb, str, str_size);


Loading…
Cancel
Save