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:
parent
b9542223a3
commit
3aa13da970
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user