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
This commit is contained in:
Leon van Stuivenberg 2004-03-15 03:29:32 +00:00 committed by Michael Niedermayer
parent 6cc270c2ac
commit e15dec10d5
3 changed files with 42 additions and 6 deletions

View file

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