summaryrefslogtreecommitdiff
path: root/libavformat/isom.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2010-01-30 21:50:47 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2010-01-30 21:50:47 +0000
commit832ec42858430fc9c949fd9bcbac2a8e8e192ee2 (patch)
tree648d1c57ab8354dd5fbcfc9438adf620507a1ef2 /libavformat/isom.c
parentc676895fd936ea462e8d9add1809208474cd11ad (diff)
Simplify conversion to 5-bit ASCII.
Originally committed as revision 21557 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/isom.c')
-rw-r--r--libavformat/isom.c9
1 files 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;
}