aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2012-03-21 14:18:16 -0700
committerReinhard Tartler <siretart@tauware.de>2014-05-31 20:07:51 -0400
commit5463a2b0566b34b9e3847db9ceb1ef1d2a6004fc (patch)
tree1e4baaa95e4ce5d3438a720be27f8aae31865cf5
parent42dcfe32a86772488bc15e025ba05d712d372c4c (diff)
downloadffmpeg-5463a2b0566b34b9e3847db9ceb1ef1d2a6004fc.tar.gz
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. (cherry picked from commit 9e71cc81f3655cacf0f91860fba3043f13b64059) (cherry picked from commit 7940306a47df602be4f57a62175706265bbfd0aa)
-rw-r--r--libavformat/isom.c2
-rw-r--r--libavformat/mov.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/isom.c b/libavformat/isom.c
index 07f22ca123..347c992031 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -339,7 +339,7 @@ int ff_mov_lang_to_iso639(unsigned code, char to[4])
memset(to, 0, 4);
/* is it the mangled iso code? */
/* 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--) {
to[i] = 0x60 + (code & 0x1f);
code >>= 5;
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 28c89f1c6f..d59a66e798 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -248,7 +248,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (parse)
parse(c, pb, str_size, key);
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));
} else {
avio_read(pb, str, str_size);