1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avformat/aviobuf: Make ffio_set_buf_size() static

Possible since 9c3adb7ce2.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-08-05 01:58:57 +02:00
parent 19093100fd
commit 530ac6aa30
2 changed files with 5 additions and 6 deletions

View File

@ -83,9 +83,6 @@ uint64_t ffio_read_varlen(AVIOContext *bc);
*/ */
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size); int ffio_read_size(AVIOContext *s, unsigned char *buf, int size);
/** @warning must be called before any I/O */
int ffio_set_buf_size(AVIOContext *s, int buf_size);
/** /**
* Reallocate a given buffer for AVIOContext. * Reallocate a given buffer for AVIOContext.
* *

View File

@ -74,6 +74,8 @@ const AVClass ff_avio_class = {
static void fill_buffer(AVIOContext *s); static void fill_buffer(AVIOContext *s);
static int url_resetbuf(AVIOContext *s, int flags); static int url_resetbuf(AVIOContext *s, int flags);
/** @warning must be called before any I/O */
static int set_buf_size(AVIOContext *s, int buf_size);
int ffio_init_context(AVIOContext *s, int ffio_init_context(AVIOContext *s,
unsigned char *buffer, unsigned char *buffer,
@ -543,7 +545,7 @@ static void fill_buffer(AVIOContext *s)
/* make buffer smaller in case it ended up large after probing */ /* make buffer smaller in case it ended up large after probing */
if (s->read_packet && s->orig_buffer_size && s->buffer_size > s->orig_buffer_size && len >= s->orig_buffer_size) { if (s->read_packet && s->orig_buffer_size && s->buffer_size > s->orig_buffer_size && len >= s->orig_buffer_size) {
if (dst == s->buffer && s->buf_ptr != dst) { if (dst == s->buffer && s->buf_ptr != dst) {
int ret = ffio_set_buf_size(s, s->orig_buffer_size); int ret = set_buf_size(s, s->orig_buffer_size);
if (ret < 0) if (ret < 0)
av_log(s, AV_LOG_WARNING, "Failed to decrease buffer size\n"); av_log(s, AV_LOG_WARNING, "Failed to decrease buffer size\n");
@ -1040,7 +1042,7 @@ int ffio_limit(AVIOContext *s, int size)
return size; return size;
} }
int ffio_set_buf_size(AVIOContext *s, int buf_size) static int set_buf_size(AVIOContext *s, int buf_size)
{ {
uint8_t *buffer; uint8_t *buffer;
buffer = av_malloc(buf_size); buffer = av_malloc(buf_size);
@ -1062,7 +1064,7 @@ int ffio_realloc_buf(AVIOContext *s, int buf_size)
int data_size; int data_size;
if (!s->buffer_size) if (!s->buffer_size)
return ffio_set_buf_size(s, buf_size); return set_buf_size(s, buf_size);
if (buf_size <= s->buffer_size) if (buf_size <= s->buffer_size)
return 0; return 0;