[SCM] libav/experimental: Simplify get_byte and url_fgetc.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:12:38 UTC 2013


The following commit has been merged in the experimental branch:
commit 3aa13da97000ec921fb9a7eeb65fde143f3b482b
Author: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
Date:   Sun Jul 25 14:33:40 2010 +0000

    Simplify get_byte and url_fgetc.
    
    Originally committed as revision 24494 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 941691a..0ee04b0 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)

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list