[FFmpeg-soc] [soc]: r665 - matroska/matroskaenc.c

conrad subversion at mplayerhq.hu
Fri Aug 10 01:37:24 CEST 2007


Author: conrad
Date: Fri Aug 10 01:37:23 2007
New Revision: 665

Log:
Simplify put_ebml_id()


Modified:
   matroska/matroskaenc.c

Modified: matroska/matroskaenc.c
==============================================================================
--- matroska/matroskaenc.c	(original)
+++ matroska/matroskaenc.c	Fri Aug 10 01:37:23 2007
@@ -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));
 }
 
 /**



More information about the FFmpeg-soc mailing list