From 897d3eef4c7ba35ec820dd5e2b378f8e368e9a18 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 3 Nov 2007 18:26:42 +0000 Subject: Make get_v() available to the other demuxers Originally committed as revision 10911 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/avio.h | 2 ++ libavformat/aviobuf.c | 11 +++++++++++ libavformat/nutdec.c | 11 ----------- 3 files changed, 13 insertions(+), 11 deletions(-) (limited to 'libavformat') diff --git a/libavformat/avio.h b/libavformat/avio.h index 6a9cbae539..8173b2b4d6 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -192,6 +192,8 @@ unsigned int get_be24(ByteIOContext *s); unsigned int get_be32(ByteIOContext *s); uint64_t get_be64(ByteIOContext *s); +uint64_t get_v(ByteIOContext *bc); + static inline int url_is_streamed(ByteIOContext *s) { return s->is_streamed; diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index c186aa2ea3..1be4480c0d 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -472,6 +472,17 @@ uint64_t get_be64(ByteIOContext *s) return val; } +uint64_t get_v(ByteIOContext *bc){ + uint64_t val = 0; + int tmp; + + do{ + tmp = get_byte(bc); + val= (val<<7) + (tmp&127); + }while(tmp&128); + return val; +} + /* link with avio functions */ #ifdef CONFIG_MUXERS diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index e3b117d8bf..c940c7ee72 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -27,17 +27,6 @@ #undef NDEBUG #include -static uint64_t get_v(ByteIOContext *bc){ - uint64_t val = 0; - int tmp; - - 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){ unsigned int len= get_v(bc); -- cgit v1.2.3