[SCM] libav/experimental: Simplify put_ebml_id()

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:06:32 UTC 2013


The following commit has been merged in the experimental branch:
commit 432adc130c09d995508ae482323bdf0af3708048
Author: David Conrad <lessen42 at gmail.com>
Date:   Wed Sep 5 00:24:36 2007 +0000

    Simplify put_ebml_id()
    
    Originally committed as revision 10351 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 194d320..55171cb 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -74,13 +74,9 @@ static int ebml_id_size(unsigned int id)
 
 static void put_ebml_id(ByteIOContext *pb, unsigned int id)
 {
-    if (id >= 0x3fffff)
-        put_byte(pb, id >> 24);
-    if (id >= 0x7fff)
-        put_byte(pb, id >> 16);
-    if (id >= 0xff)
-        put_byte(pb, id >> 8);
-    put_byte(pb, id);
+    int i = ebml_id_size(id);
+    while (i--)
+        put_byte(pb, id >> (i*8));
 }
 
 /**

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list