diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-07-25 14:33:40 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-07-25 14:33:40 +0000 |
commit | 3aa13da97000ec921fb9a7eeb65fde143f3b482b (patch) | |
tree | af39b10636b74d1244d375b7ce2a874dbcc61684 /libavformat/aviobuf.c | |
parent | b9542223a3f338e98e1d795273c2aaae775ae898 (diff) | |
download | ffmpeg-3aa13da97000ec921fb9a7eeb65fde143f3b482b.tar.gz |
Simplify get_byte and url_fgetc.
Originally committed as revision 24494 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r-- | libavformat/aviobuf.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 941691adb6..0ee04b0c64 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -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) |