# HG changeset patch # User conrad # Date 1188951920 0 # Node ID 215eef1f3f37b5a2decc8532fcece767a284e343 # Parent 9c3067533891c9cac292d6da0c8a742b32ccff82 Simplify diff -r 9c3067533891 -r 215eef1f3f37 matroskaenc.c --- 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); } /**