changeset 5610:eaae42073860 libavformat

Simplify conversion to 5-bit ASCII.
author reimar
date Sat, 30 Jan 2010 21:50:47 +0000
parents 26c471598b2f
children 1338a4972dd4
files isom.c
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/isom.c	Sat Jan 30 20:18:55 2010 +0000
+++ b/isom.c	Sat Jan 30 21:50:47 2010 +0000
@@ -283,13 +283,12 @@
         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;
 }