[05/13] avio: make url_setbufsize internal.

Message ID 1300131546-2880-5-git-send-email-anton@khirnov.net
State Committed
Commit 59f65d9579262651731e9a22845957d78b4c4f57
Headers show

Commit Message

Anton Khirnov March 14, 2011, 7:38 p.m.
---
 libavformat/avio.h          |    3 +--
 libavformat/avio_internal.h |    3 +++
 libavformat/aviobuf.c       |    8 ++++++--
 libavformat/utils.c         |    2 +-
 4 files changed, 11 insertions(+), 5 deletions(-)

Comments

Ronald Bultje March 17, 2011, 2:41 a.m. | #1
Hi,

On Mon, Mar 14, 2011 at 3:38 PM, Anton Khirnov <anton@khirnov.net> wrote:
> ---
>  libavformat/avio.h          |    3 +--
>  libavformat/avio_internal.h |    3 +++
>  libavformat/aviobuf.c       |    8 ++++++--
>  libavformat/utils.c         |    2 +-
>  4 files changed, 11 insertions(+), 5 deletions(-)

OK, queued.

Ronald

Patch

diff --git a/libavformat/avio.h b/libavformat/avio.h
index d4d9f82..b9d181f 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -438,6 +438,7 @@  attribute_deprecated int64_t url_ftell(AVIOContext *s);
 attribute_deprecated int64_t url_fsize(AVIOContext *s);
 #define URL_EOF (-1)
 attribute_deprecated int url_fgetc(AVIOContext *s);
+attribute_deprecated int url_setbufsize(AVIOContext *s, int buf_size);
 /**
  * @}
  */
@@ -600,8 +601,6 @@  attribute_deprecated static inline int url_is_streamed(AVIOContext *s)
  */
 int url_fdopen(AVIOContext **s, URLContext *h);
 
-/** @warning must be called before any I/O */
-int url_setbufsize(AVIOContext *s, int buf_size);
 #if FF_API_URL_RESETBUF
 /** Reset the buffer for reading or writing.
  * @note Will drop any data currently in the buffer without transmitting it.
diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h
index 2e0b94c..12578fa 100644
--- a/libavformat/avio_internal.h
+++ b/libavformat/avio_internal.h
@@ -63,4 +63,7 @@  int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char *buf, int buf_size
 
 uint64_t ffio_read_varlen(AVIOContext *bc);
 
+/** @warning must be called before any I/O */
+int ffio_set_buf_size(AVIOContext *s, int buf_size);
+
 #endif // AVFORMAT_AVIO_INTERNAL_H
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index dd752f5..93dd83a 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -380,6 +380,10 @@  int64_t url_fsize(AVIOContext *s)
 {
     return avio_size(s);
 }
+int url_setbufsize(AVIOContext *s, int buf_size)
+{
+    return ffio_set_buf_size(s, buf_size);
+}
 #endif
 
 int avio_put_str(AVIOContext *s, const char *str)
@@ -493,7 +497,7 @@  static void fill_buffer(AVIOContext *s)
 
     /* make buffer smaller in case it ended up large after probing */
     if (s->buffer_size > max_buffer_size) {
-        url_setbufsize(s, max_buffer_size);
+        ffio_set_buf_size(s, max_buffer_size);
 
         s->checksum_ptr = dst = s->buffer;
         len = s->buffer_size;
@@ -807,7 +811,7 @@  int url_fdopen(AVIOContext **s, URLContext *h)
     return 0;
 }
 
-int url_setbufsize(AVIOContext *s, int buf_size)
+int ffio_set_buf_size(AVIOContext *s, int buf_size)
 {
     uint8_t *buffer;
     buffer = av_malloc(buf_size);
diff --git a/libavformat/utils.c b/libavformat/utils.c
index ce2fb4d..3ec7a67 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -621,7 +621,7 @@  int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
             goto fail;
         }
         if (buf_size > 0) {
-            url_setbufsize(pb, buf_size);
+            ffio_set_buf_size(pb, buf_size);
         }
         if (!fmt && (err = av_probe_input_buffer(pb, &fmt, filename, logctx, 0, logctx ? (*ic_ptr)->probesize : 0)) < 0) {
             goto fail;