diff options
author | Leon van Stuivenberg <leonvs@iae.nl> | 2004-03-15 03:29:32 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-03-15 03:29:32 +0000 |
commit | e15dec10d5eb1fba001714a512779f459a8b51fc (patch) | |
tree | b5f2e49b3f86e488550c77e07b8734d46a907379 /libavformat/aviobuf.c | |
parent | 6cc270c2acba1c236e249ec76f877cf014ee70f5 (diff) | |
download | ffmpeg-e15dec10d5eb1fba001714a512779f459a8b51fc.tar.gz |
decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
Originally committed as revision 2896 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r-- | libavformat/aviobuf.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index de140966c6..75f97a5b40 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -309,6 +309,22 @@ int get_buffer(ByteIOContext *s, unsigned char *buf, int size) 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; |