Browse Source

Make get_v() available to the other demuxers

Originally committed as revision 10911 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Kostya Shishkov 18 years ago
parent
commit
897d3eef4c
3 changed files with 13 additions and 11 deletions
  1. +2
    -0
      libavformat/avio.h
  2. +11
    -0
      libavformat/aviobuf.c
  3. +0
    -11
      libavformat/nutdec.c

+ 2
- 0
libavformat/avio.h View File

@@ -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;


+ 11
- 0
libavformat/aviobuf.c View File

@@ -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


+ 0
- 11
libavformat/nutdec.c View File

@@ -27,17 +27,6 @@
#undef NDEBUG
#include <assert.h>

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);



Loading…
Cancel
Save