[FFmpeg-cvslog] avio: move ff_rewind_with_probe_data from avio.h to avio_internal.h

Anton Khirnov git
Tue Mar 8 02:43:29 CET 2011


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sun Mar  6 20:08:30 2011 +0100| [f8bc86d47e8997b9e78e26a90f3884ffe9b55f5e] | committer: Michael Niedermayer

avio: move ff_rewind_with_probe_data from avio.h to avio_internal.h

also change its prefix to ffio

Signed-off-by: Ronald S. Bultje <rsbultje at gmail.com>
(cherry picked from commit f1ef2cd9ed22be231bb4da8d2f93d9a0c7877aa7)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f8bc86d47e8997b9e78e26a90f3884ffe9b55f5e
---

 libavformat/avio.h          |   15 ---------------
 libavformat/avio_internal.h |   14 ++++++++++++++
 libavformat/aviobuf.c       |    2 +-
 libavformat/utils.c         |    3 ++-
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/libavformat/avio.h b/libavformat/avio.h
index 0d83755..342980d 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -595,21 +595,6 @@ int url_resetbuf(AVIOContext *s, int flags);
 #endif
 
 /**
- * Rewind the AVIOContext using the specified buffer containing the first buf_size bytes of the file.
- * Used after probing to avoid seeking.
- * Joins buf and s->buffer, taking any overlap into consideration.
- * @note s->buffer must overlap with buf or they can't be joined and the function fails
- * @note This function is NOT part of the public API
- *
- * @param s The read-only AVIOContext to rewind
- * @param buf The probe buffer containing the first buf_size bytes of the file
- * @param buf_size The size of buf
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code in case of failure
- */
-int ff_rewind_with_probe_data(AVIOContext *s, unsigned char *buf, int buf_size);
-
-/**
  * Create and initialize a AVIOContext for accessing the
  * resource indicated by url.
  * @note When the resource indicated by url has been opened in
diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h
index 279c7f6..3abb619 100644
--- a/libavformat/avio_internal.h
+++ b/libavformat/avio_internal.h
@@ -47,4 +47,18 @@ static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
     avio_wl32(pb, MKTAG(s[0], s[1], s[2], s[3]));
 }
 
+/**
+ * Rewind the AVIOContext using the specified buffer containing the first buf_size bytes of the file.
+ * Used after probing to avoid seeking.
+ * Joins buf and s->buffer, taking any overlap into consideration.
+ * @note s->buffer must overlap with buf or they can't be joined and the function fails
+ *
+ * @param s The read-only AVIOContext to rewind
+ * @param buf The probe buffer containing the first buf_size bytes of the file
+ * @param buf_size The size of buf
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code in case of failure
+ */
+int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char *buf, int buf_size);
+
 #endif // AVFORMAT_AVIO_INTERNAL_H
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 6592e9a..7762d6c 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -837,7 +837,7 @@ static int url_resetbuf(AVIOContext *s, int flags)
     return 0;
 }
 
-int ff_rewind_with_probe_data(AVIOContext *s, unsigned char *buf, int buf_size)
+int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char *buf, int buf_size)
 {
     int64_t buffer_start;
     int buffer_size;
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 25c600a..c38c9ca 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include "avformat.h"
+#include "avio_internal.h"
 #include "internal.h"
 #include "libavcodec/internal.h"
 #include "libavutil/opt.h"
@@ -585,7 +586,7 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
     }
 
     /* rewind. reuse probe buffer to avoid seeking */
-    if ((ret = ff_rewind_with_probe_data(pb, buf, pd.buf_size)) < 0)
+    if ((ret = ffio_rewind_with_probe_data(pb, buf, pd.buf_size)) < 0)
         av_free(buf);
 
     return ret;




More information about the ffmpeg-cvslog mailing list