Revision 603e5c0b

View differences:

libavformat/aviobuf.c
23 23
#include "libavutil/intreadwrite.h"
24 24
#include "avformat.h"
25 25
#include "avio.h"
26
#include "internal.h"
26 27
#include <stdarg.h>
27 28

  
28 29
#define IO_BUFFER_SIZE 32768
......
248 249
        put_byte(s, 0);
249 250
}
250 251

  
252
int ff_get_v_length(uint64_t val){
253
    int i=1;
254

  
255
    while(val>>=7)
256
        i++;
257

  
258
    return i;
259
}
260

  
261
void ff_put_v(ByteIOContext *bc, uint64_t val){
262
    int i= ff_get_v_length(val);
263

  
264
    while(--i>0)
265
        put_byte(bc, 128 | (val>>(7*i)));
266

  
267
    put_byte(bc, val&127);
268
}
269

  
251 270
void put_le64(ByteIOContext *s, uint64_t val)
252 271
{
253 272
    put_le32(s, (uint32_t)(val & 0xffffffff));
libavformat/internal.h
157 157
int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt,
158 158
                     AVFormatContext *src);
159 159

  
160
/**
161
 * Get the length in bytes which is needed to store val as v.
162
 */
163
int ff_get_v_length(uint64_t val);
164

  
165
/**
166
 * Put val using a variable number of bytes.
167
 */
168
void ff_put_v(ByteIOContext *bc, uint64_t val);
169

  
160 170
#endif /* AVFORMAT_INTERNAL_H */
libavformat/nutenc.c
241 241
    nut->frame_code['N'].flags= FLAG_INVALID;
242 242
}
243 243

  
244
/**
245
 * Get the length in bytes which is needed to store val as v.
246
 */
247
static int ff_get_v_length(uint64_t val){
248
    int i=1;
249

  
250
    while(val>>=7)
251
        i++;
252

  
253
    return i;
254
}
255

  
256
static void ff_put_v(ByteIOContext *bc, uint64_t val){
257
    int i= ff_get_v_length(val);
258

  
259
    while(--i>0)
260
        put_byte(bc, 128 | (val>>(7*i)));
261

  
262
    put_byte(bc, val&127);
263
}
264

  
265 244
static void put_tt(NUTContext *nut, StreamContext *nus, ByteIOContext *bc, uint64_t val){
266 245
    val *= nut->time_base_count;
267 246
    val += nus->time_base - nut->time_base;

Also available in: Unified diff