Simplify get_byte and url_fgetc.

Originally committed as revision 24494 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Reimar Döffinger 2010-07-25 14:33:40 +00:00
parent b9542223a3
commit 3aa13da970
1 changed files with 2 additions and 8 deletions

View File

@ -390,28 +390,22 @@ void init_checksum(ByteIOContext *s,
/* XXX: put an inline version */
int get_byte(ByteIOContext *s)
{
if (s->buf_ptr < s->buf_end) {
return *s->buf_ptr++;
} else {
if (s->buf_ptr >= s->buf_end)
fill_buffer(s);
if (s->buf_ptr < s->buf_end)
return *s->buf_ptr++;
else
return 0;
}
}
int url_fgetc(ByteIOContext *s)
{
if (s->buf_ptr < s->buf_end) {
return *s->buf_ptr++;
} else {
if (s->buf_ptr >= s->buf_end)
fill_buffer(s);
if (s->buf_ptr < s->buf_end)
return *s->buf_ptr++;
else
return URL_EOF;
}
}
int get_buffer(ByteIOContext *s, unsigned char *buf, int size)