[FFmpeg-cvslog] r24494 - trunk/libavformat/aviobuf.c

reimar subversion
Sun Jul 25 16:33:40 CEST 2010


Author: reimar
Date: Sun Jul 25 16:33:40 2010
New Revision: 24494

Log:
Simplify get_byte and url_fgetc.

Modified:
   trunk/libavformat/aviobuf.c

Modified: trunk/libavformat/aviobuf.c
==============================================================================
--- trunk/libavformat/aviobuf.c	Sun Jul 25 16:33:16 2010	(r24493)
+++ trunk/libavformat/aviobuf.c	Sun Jul 25 16:33:40 2010	(r24494)
@@ -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)



More information about the ffmpeg-cvslog mailing list