|
|
|
@@ -28,6 +28,9 @@ |
|
|
|
#define IO_BUFFER_SIZE 32768 |
|
|
|
|
|
|
|
static void fill_buffer(ByteIOContext *s); |
|
|
|
#if LIBAVFORMAT_VERSION_MAJOR >= 53 |
|
|
|
static int url_resetbuf(ByteIOContext *s, int flags); |
|
|
|
#endif |
|
|
|
|
|
|
|
int init_put_byte(ByteIOContext *s, |
|
|
|
unsigned char *buffer, |
|
|
|
@@ -583,11 +586,19 @@ int url_setbufsize(ByteIOContext *s, int buf_size) |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
#if LIBAVFORMAT_VERSION_MAJOR < 53 |
|
|
|
int url_resetbuf(ByteIOContext *s, int flags) |
|
|
|
#else |
|
|
|
static int url_resetbuf(ByteIOContext *s, int flags) |
|
|
|
#endif |
|
|
|
{ |
|
|
|
#if LIBAVFORMAT_VERSION_MAJOR < 53 |
|
|
|
URLContext *h = s->opaque; |
|
|
|
if ((flags & URL_RDWR) || (h && h->flags != flags && !h->flags & URL_RDWR)) |
|
|
|
return AVERROR(EINVAL); |
|
|
|
#else |
|
|
|
assert(flags == URL_WRONLY || flags == URL_RDONLY); |
|
|
|
#endif |
|
|
|
|
|
|
|
if (flags & URL_WRONLY) { |
|
|
|
s->buf_end = s->buffer + s->buffer_size; |
|
|
|
|