[FFmpeg-devel] [PATCH 7/7] avio: avio_ prefix for url_fgetc

Anton Khirnov anton
Sun Mar 6 18:04:52 CET 2011


---
 libavformat/avio.h    |    8 +++++---
 libavformat/aviobuf.c |   12 ++++++++----
 libavformat/mpegts.c  |    2 +-
 libavformat/oggdec.c  |    8 ++++----
 4 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/libavformat/avio.h b/libavformat/avio.h
index b3bcebf..9aa8dd6 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -427,6 +427,8 @@ attribute_deprecated int64_t url_fsize(AVIOContext *s);
 attribute_deprecated int url_feof(AVIOContext *s);
 attribute_deprecated int url_ferror(AVIOContext *s);
 attribute_deprecated int url_setbufsize(AVIOContext *s, int buf_size);
+#define URL_EOF AVIO_EOF
+attribute_deprecated int url_fgetc(AVIOContext *s);
 /**
  * @}
  */
@@ -504,9 +506,9 @@ int av_url_read_fpause(AVIOContext *h, int pause);
 int64_t av_url_read_fseek(AVIOContext *h, int stream_index,
                           int64_t timestamp, int flags);
 
-#define URL_EOF (-1)
-/** @note return URL_EOF (-1) if EOF */
-int url_fgetc(AVIOContext *s);
+#define AVIO_EOF (-1)
+/** @note return AVIO_EOF (-1) if EOF */
+int avio_getc(AVIOContext *s);
 
 /** @warning currently size is limited */
 #ifdef __GNUC__
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index a7e6f2a..58c55f2 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -381,6 +381,10 @@ int url_setbufsize(AVIOContext *s, int buf_size)
 {
     return avio_setbufsize(s, buf_size);
 }
+int url_fgetc(AVIOContext *s)
+{
+    return avio_getc(s);
+}
 #endif
 
 int avio_put_str(AVIOContext *s, const char *str)
@@ -551,13 +555,13 @@ int avio_r8(AVIOContext *s)
     return 0;
 }
 
-int url_fgetc(AVIOContext *s)
+int avio_getc(AVIOContext *s)
 {
     if (s->buf_ptr >= s->buf_end)
         fill_buffer(s);
     if (s->buf_ptr < s->buf_end)
         return *s->buf_ptr++;
-    return URL_EOF;
+    return AVIO_EOF;
 }
 
 int avio_read(AVIOContext *s, unsigned char *buf, int size)
@@ -931,7 +935,7 @@ char *url_fgets(AVIOContext *s, char *buf, int buf_size)
     int c;
     char *q;
 
-    c = url_fgetc(s);
+    c = avio_getc(s);
     if (c == EOF)
         return NULL;
     q = buf;
@@ -940,7 +944,7 @@ char *url_fgets(AVIOContext *s, char *buf, int buf_size)
             break;
         if ((q - buf) < buf_size - 1)
             *q++ = c;
-        c = url_fgetc(s);
+        c = avio_getc(s);
     }
     if (buf_size > 0)
         *q = '\0';
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index b1b329e..d7d9af5 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1312,7 +1312,7 @@ static int mpegts_resync(AVFormatContext *s)
     int c, i;
 
     for(i = 0;i < MAX_RESYNC_SIZE; i++) {
-        c = url_fgetc(pb);
+        c = avio_getc(pb);
         if (c < 0)
             return -1;
         if (c == 0x47) {
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 5d34fab..cd51634 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -218,7 +218,7 @@ ogg_read_page (AVFormatContext * s, int *str)
             sync[(sp + 2) & 3] == 'g' && sync[(sp + 3) & 3] == 'S')
             break;
 
-        c = url_fgetc (bc);
+        c = avio_getc(bc);
         if (c < 0)
             return -1;
         sync[sp++ & 3] = c;
@@ -229,15 +229,15 @@ ogg_read_page (AVFormatContext * s, int *str)
         return -1;
     }
 
-    if (url_fgetc (bc) != 0)      /* version */
+    if (avio_getc(bc) != 0)      /* version */
         return -1;
 
-    flags = url_fgetc (bc);
+    flags = avio_getc(bc);
     gp = avio_rl64 (bc);
     serial = avio_rl32 (bc);
     seq = avio_rl32 (bc);
     crc = avio_rl32 (bc);
-    nsegs = url_fgetc (bc);
+    nsegs = avio_getc(bc);
 
     idx = ogg_find_stream (ogg, serial);
     if (idx < 0){
-- 
1.7.4.1




More information about the ffmpeg-devel mailing list