Mercurial > libavformat.hg
diff aviobuf.c @ 389:e14fcd57ad2f libavformat
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
| author | michael |
|---|---|
| date | Mon, 15 Mar 2004 03:29:32 +0000 |
| parents | 0d74e8abcb3d |
| children | 41da3366d341 |
line wrap: on
line diff
--- a/aviobuf.c Sun Mar 14 19:40:43 2004 +0000 +++ b/aviobuf.c Mon Mar 15 03:29:32 2004 +0000 @@ -309,6 +309,22 @@ return size1 - size; } +int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size) +{ + int len; + + len = s->buf_end - s->buf_ptr; + if (len == 0) { + fill_buffer(s); + len = s->buf_end - s->buf_ptr; + } + if (len > size) + len = size; + memcpy(buf, s->buf_ptr, len); + s->buf_ptr += len; + return len; +} + unsigned int get_le16(ByteIOContext *s) { unsigned int val;
