diff options
author | David Conrad <lessen42@gmail.com> | 2007-09-05 00:24:36 +0000 |
---|---|---|
committer | David Conrad <lessen42@gmail.com> | 2007-09-05 00:24:36 +0000 |
commit | 432adc130c09d995508ae482323bdf0af3708048 (patch) | |
tree | 4fdfa15e963f68ccdeb06175f6aa27f50a62c5e9 /libavformat/matroskaenc.c | |
parent | 22ccb69a7f28daf50fc2f03335cddbc1c66181ec (diff) | |
download | ffmpeg-432adc130c09d995508ae482323bdf0af3708048.tar.gz |
Simplify put_ebml_id()
Originally committed as revision 10351 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r-- | libavformat/matroskaenc.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 194d32082c..55171cba66 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -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)); } /** |