1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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

View File

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