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 */
|
/* 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)
|
||||||
|
Loading…
Reference in New Issue
Block a user