Mercurial > libavcodec.hg
changeset 2098:9a1f3f29bf99 libavcodec
skip_utf8, unused yet
author | alex |
---|---|
date | Sat, 26 Jun 2004 10:09:19 +0000 |
parents | dd81e5be0c7a |
children | acc845e25a68 |
files | flac.c |
diffstat | 1 files changed, 21 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flac.c Sat Jun 26 10:08:49 2004 +0000 +++ b/flac.c Sat Jun 26 10:09:19 2004 +0000 @@ -142,6 +142,27 @@ return val; } +static int skip_utf8(GetBitContext *gb) +{ + int ones=0, bytes; + + while(get_bits1(gb)) + ones++; + + if (ones==0) bytes=0; + else if(ones==1) return -1; + else bytes= ones - 1; + + skip_bits(gb, 7-ones); + while(bytes--){ + const int tmp = get_bits(gb, 8); + + if((tmp>>6) != 2) + return -1; + } + return 0; +} + static int get_crc8(const uint8_t *buf, int count){ int crc=0; int i;