From 832ec42858430fc9c949fd9bcbac2a8e8e192ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Sat, 30 Jan 2010 21:50:47 +0000 Subject: [PATCH] Simplify conversion to 5-bit ASCII. Originally committed as revision 21557 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/isom.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libavformat/isom.c b/libavformat/isom.c index 9318facb59..e54a5c9686 100644 --- a/libavformat/isom.c +++ b/libavformat/isom.c @@ -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; }