Mercurial > libavformat.hg
diff nutdec.c @ 1682:1c6ee4cf8a38 libavformat
simplify
author | michael |
---|---|
date | Sun, 21 Jan 2007 12:43:29 +0000 |
parents | 10be48ec6b57 |
children | ec025d5fbbe2 |
line wrap: on
line diff
--- a/nutdec.c Sun Jan 21 12:31:58 2007 +0000 +++ b/nutdec.c Sun Jan 21 12:43:29 2007 +0000 @@ -29,18 +29,13 @@ static uint64_t get_v(ByteIOContext *bc){ uint64_t val = 0; - - for(;;) - { - int tmp = get_byte(bc); + int tmp; - if (tmp&0x80) - val= (val<<7) + tmp - 0x80; - else{ - return (val<<7) + tmp; - } - } - return -1; + do{ + tmp = get_byte(bc); + val= (val<<7) + (tmp&127); + }while(tmp&128); + return val; } static int get_str(ByteIOContext *bc, char *string, unsigned int maxlen){