comparison matroskaenc.c @ 3097:298c49463701 libavformat

simplification proposed by Rich
author aurel
date Sat, 01 Mar 2008 00:26:19 +0000
parents b519194083e6
children ea5623a8efde
comparison
equal deleted inserted replaced
3096:ce8ea5400041 3097:298c49463701
147 } 147 }
148 148
149 static void put_ebml_uint(ByteIOContext *pb, unsigned int elementid, uint64_t val) 149 static void put_ebml_uint(ByteIOContext *pb, unsigned int elementid, uint64_t val)
150 { 150 {
151 int i, bytes = 1; 151 int i, bytes = 1;
152 while (bytes < 8 && val >> bytes*8) bytes++; 152 uint64_t tmp = val;
153 while (tmp>>=8) bytes++;
153 154
154 put_ebml_id(pb, elementid); 155 put_ebml_id(pb, elementid);
155 put_ebml_num(pb, bytes, 0); 156 put_ebml_num(pb, bytes, 0);
156 for (i = bytes - 1; i >= 0; i--) 157 for (i = bytes - 1; i >= 0; i--)
157 put_byte(pb, val >> i*8); 158 put_byte(pb, val >> i*8);