1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Simplify conversion to 5-bit ASCII.

Originally committed as revision 21557 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Reimar Döffinger 2010-01-30 21:50:47 +00:00
parent c676895fd9
commit 832ec42858

View File

@ -283,13 +283,12 @@ int ff_mov_iso639_to_lang(const char *lang, int mp4)
lang = "und"; lang = "und";
/* 5bit ascii */ /* 5bit ascii */
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
unsigned char c = (unsigned char)lang[i]; uint8_t c = lang[i];
if (c < 0x60) c -= 0x60;
return -1; if (c > 0x1f)
if (c > 0x60 + 0x1f)
return -1; return -1;
code <<= 5; code <<= 5;
code |= (c - 0x60); code |= c;
} }
return code; return code;
} }