[SCM] libav/experimental: Simplify conversion to 5-bit ASCII.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:59:04 UTC 2013


The following commit has been merged in the experimental branch:
commit 832ec42858430fc9c949fd9bcbac2a8e8e192ee2
Author: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
Date:   Sat Jan 30 21:50:47 2010 +0000

    Simplify conversion to 5-bit ASCII.
    
    Originally committed as revision 21557 to svn://svn.ffmpeg.org/ffmpeg/trunk

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;
 }

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list