diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-01-30 21:50:47 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-01-30 21:50:47 +0000 |
commit | 832ec42858430fc9c949fd9bcbac2a8e8e192ee2 (patch) | |
tree | 648d1c57ab8354dd5fbcfc9438adf620507a1ef2 | |
parent | c676895fd936ea462e8d9add1809208474cd11ad (diff) | |
download | ffmpeg-streaming-832ec42858430fc9c949fd9bcbac2a8e8e192ee2.zip ffmpeg-streaming-832ec42858430fc9c949fd9bcbac2a8e8e192ee2.tar.gz |
Simplify conversion to 5-bit ASCII.
Originally committed as revision 21557 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/isom.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libavformat/isom.c b/libavformat/isom.c index 9318fac..e54a5c9 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; } |