aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/avc.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-01-16 01:11:34 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-01-16 01:11:34 +0000
commita97772b166ff5cd1c7dfaa9a3bca7303cca0b582 (patch)
treef7ae860561b78ced4dba05713ab712f8d05bcefe /libavformat/avc.c
parent764551c672bfc9d87ceef31ba5f111ca02533e1a (diff)
downloadffmpeg-a97772b166ff5cd1c7dfaa9a3bca7303cca0b582.tar.gz
return size written in ff_avc_parse_nal_units
Originally committed as revision 16622 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avc.c')
-rw-r--r--libavformat/avc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/avc.c b/libavformat/avc.c
index def08ba5e9..09f31a15fe 100644
--- a/libavformat/avc.c
+++ b/libavformat/avc.c
@@ -60,20 +60,23 @@ const uint8_t *ff_avc_find_startcode(const uint8_t *p, const uint8_t *end)
return end + 3;
}
-void ff_avc_parse_nal_units(ByteIOContext *pb, const uint8_t *buf_in, int size)
+int ff_avc_parse_nal_units(ByteIOContext *pb, const uint8_t *buf_in, int size)
{
const uint8_t *p = buf_in;
const uint8_t *end = p + size;
const uint8_t *nal_start, *nal_end;
+ size = 0;
nal_start = ff_avc_find_startcode(p, end);
while (nal_start < end) {
while(!*(nal_start++));
nal_end = ff_avc_find_startcode(nal_start, end);
put_be32(pb, nal_end - nal_start);
put_buffer(pb, nal_start, nal_end - nal_start);
+ size += 4 + nal_end - nal_start;
nal_start = nal_end;
}
+ return size;
}
static int ff_avc_parse_nal_units_buf(const uint8_t *buf_in, uint8_t **buf, int *size)