Commit 2534dad6 authored by reimar's avatar reimar

Simplify conversion to 5-bit ASCII.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@21557 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent d12b7abc
......@@ -283,13 +283,12 @@ int ff_mov_iso639_to_lang(const char *lang, int mp4)
lang = "und";
/* 5bit ascii */
for (i = 0; i < 3; i++) {
unsigned char c = (unsigned char)lang[i];
if (c < 0x60)
return -1;
if (c > 0x60 + 0x1f)
uint8_t c = lang[i];
c -= 0x60;
if (c > 0x1f)
return -1;
code <<= 5;
code |= (c - 0x60);
code |= c;
}
return code;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment