]> git.sesse.net Git - ffmpeg/commitdiff
avio: make get_partial_buffer internal.
authorAnton Khirnov <anton@khirnov.net>
Mon, 21 Feb 2011 18:28:16 +0000 (19:28 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 22 Feb 2011 01:44:37 +0000 (02:44 +0100)
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit b3db9ceef13037f2b6963a84b7abf8871a1e0f8a)

libavformat/avio.h
libavformat/avio_internal.h
libavformat/aviobuf.c
libavformat/rawdec.c

index fa71d20d59ad3e760ca4666f44b03e6e8629efe7..43d94db790a4d232caf814f678f87233abb2c5e8 100644 (file)
@@ -385,6 +385,7 @@ attribute_deprecated AVIOContext *av_alloc_put_byte(
  * @{
  */
 attribute_deprecated int          get_buffer(AVIOContext *s, unsigned char *buf, int size);
+attribute_deprecated int          get_partial_buffer(AVIOContext *s, unsigned char *buf, int size);
 attribute_deprecated int          get_byte(AVIOContext *s);
 attribute_deprecated unsigned int get_le16(AVIOContext *s);
 attribute_deprecated unsigned int get_le24(AVIOContext *s);
@@ -498,14 +499,6 @@ void put_flush_packet(AVIOContext *s);
  */
 int avio_read(AVIOContext *s, unsigned char *buf, int size);
 
-/**
- * Read size bytes from AVIOContext into buf.
- * This reads at most 1 packet. If that is not enough fewer bytes will be
- * returned.
- * @return number of bytes read or AVERROR
- */
-int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size);
-
 /** @note return 0 if EOF, so you cannot use it if EOF handling is
     necessary */
 int          avio_r8  (AVIOContext *s);
index 1cebcd72c89f67def018982960169ef0bb3ae036..16715377b52b1ea3da6b2fba87f3f3bb68ea2b6b 100644 (file)
@@ -32,4 +32,12 @@ int ffio_init_context(AVIOContext *s,
                   int64_t (*seek)(void *opaque, int64_t offset, int whence));
 
 
+/**
+ * Read size bytes from AVIOContext into buf.
+ * This reads at most 1 packet. If that is not enough fewer bytes will be
+ * returned.
+ * @return number of bytes read or AVERROR
+ */
+int ffio_read_partial(AVIOContext *s, unsigned char *buf, int size);
+
 #endif // AVFORMAT_AVIO_INTERNAL_H
index 28825506d5e2a712a595e4c3080865981406b458..fd1419893cd1101e3fdc427721a72f2df1b2e17c 100644 (file)
@@ -324,6 +324,10 @@ int get_buffer(AVIOContext *s, unsigned char *buf, int size)
 {
     return avio_read(s, buf, size);
 }
+int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size)
+{
+    return ffio_read_partial(s, buf, size);
+}
 #endif
 
 int avio_put_str(AVIOContext *s, const char *str)
@@ -548,7 +552,7 @@ int avio_read(AVIOContext *s, unsigned char *buf, int size)
     return size1 - size;
 }
 
-int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size)
+int ffio_read_partial(AVIOContext *s, unsigned char *buf, int size)
 {
     int len;
 
index 4f830e3c207b54f52761a16107ac3a8e2243acb0..1c2f1211dff41a9490288bd31a31a408f98338e9 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 #include "avformat.h"
+#include "avio_internal.h"
 #include "rawdec.h"
 
 /* raw input */
@@ -81,7 +82,7 @@ int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt)
 
     pkt->pos= url_ftell(s->pb);
     pkt->stream_index = 0;
-    ret = get_partial_buffer(s->pb, pkt->data, size);
+    ret = ffio_read_partial(s->pb, pkt->data, size);
     if (ret < 0) {
         av_free_packet(pkt);
         return ret;