Mercurial > libavformat.hg
changeset 2482:d13c92b200a8 libavformat
Simplify put_ebml_id()
author | conrad |
---|---|
date | Wed, 05 Sep 2007 00:24:36 +0000 |
parents | 3d34222171b2 |
children | d5428813739d |
files | matroskaenc.c |
diffstat | 1 files changed, 3 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/matroskaenc.c Wed Sep 05 00:24:34 2007 +0000 +++ b/matroskaenc.c Wed Sep 05 00:24:36 2007 +0000 @@ -74,13 +74,9 @@ 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)); } /**