summaryrefslogtreecommitdiff
path: root/libavformat/matroskaenc.c
diff options
context:
space:
mode:
authorDavid Conrad <lessen42@gmail.com>2007-09-05 00:23:41 +0000
committerDavid Conrad <lessen42@gmail.com>2007-09-05 00:23:41 +0000
commit6b9a10fbd352b61c286b732f9aa67f0d2f0a1301 (patch)
tree2cc131c34ec3d8eb6637a3a148b8269b3733f954 /libavformat/matroskaenc.c
parentf9c8d57b79022630c4ecc18fd6ec68e626b95b88 (diff)
Simplify
Originally committed as revision 10326 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r--libavformat/matroskaenc.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 38ee9d6f90..80c89b4c77 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -76,13 +76,7 @@ static void put_ebml_id(ByteIOContext *pb, unsigned int id)
static int ebml_id_size(unsigned int id)
{
- if (id >= 0x3fffff)
- return 4;
- if (id >= 0x7fff)
- return 3;
- if (id >= 0xff)
- return 2;
- return 1;
+ return (av_log2(id+1)-1)/7+1;
}
// XXX: test this thoroughly and get rid of minbytes hack (currently needed to