diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2004-06-26 10:09:19 +0000 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2004-06-26 10:09:19 +0000 |
commit | 41aecb13f3d9a8ef2cf55481788249e18821bf58 (patch) | |
tree | bd7222e2041c3381b4f2c2c91d3d87b57a95c00d /libavcodec/flac.c | |
parent | 0c2a9d56d4e275fe0bd8098c183aab16e74e731c (diff) | |
download | ffmpeg-streaming-41aecb13f3d9a8ef2cf55481788249e18821bf58.zip ffmpeg-streaming-41aecb13f3d9a8ef2cf55481788249e18821bf58.tar.gz |
skip_utf8, unused yet
Originally committed as revision 3256 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/flac.c')
-rw-r--r-- | libavcodec/flac.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libavcodec/flac.c b/libavcodec/flac.c index 464d799..9ccffe7 100644 --- a/libavcodec/flac.c +++ b/libavcodec/flac.c @@ -142,6 +142,27 @@ static int64_t get_utf8(GetBitContext *gb) 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; |