changeset 2496:215eef1f3f37 libavformat

Simplify
author conrad
date Wed, 05 Sep 2007 00:25:20 +0000
parents 9c3067533891
children 5da824da8e3e
files matroskaenc.c
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/matroskaenc.c	Wed Sep 05 00:25:18 2007 +0000
+++ b/matroskaenc.c	Wed Sep 05 00:25:20 2007 +0000
@@ -104,14 +104,10 @@
  */
 static void put_ebml_size_unknown(ByteIOContext *pb, int bytes)
 {
-    uint64_t value = 0;
-    int i;
-
     bytes = FFMIN(bytes, 8);
-    for (i = 0; i < bytes*7 + 1; i++)
-        value |= 1ULL << i;
-    for (i = bytes-1; i >= 0; i--)
-        put_byte(pb, value >> i*8);
+    put_byte(pb, 0x1ff >> bytes);
+    while (--bytes)
+        put_byte(pb, 0xff);
 }
 
 /**