#define SHORT_SEEK_THRESHOLD 4096
static void fill_buffer(ByteIOContext *s);
-#if LIBAVFORMAT_VERSION_MAJOR >= 53
+#if !FF_API_URL_RESETBUF
static int url_resetbuf(ByteIOContext *s, int flags);
#endif
flush_buffer(s);
}
+void put_nbyte(ByteIOContext *s, int b, int count)
+{
+ while (count > 0) {
+ int len = FFMIN(s->buf_end - s->buf_ptr, count);
+ memset(s->buf_ptr, b, len);
+ s->buf_ptr += len;
+
+ if (s->buf_ptr >= s->buf_end)
+ flush_buffer(s);
+
+ count -= len;
+ }
+}
+
void put_buffer(ByteIOContext *s, const unsigned char *buf, int size)
{
while (size > 0) {
return 0;
}
-#if LIBAVFORMAT_VERSION_MAJOR < 53
+#if FF_API_URL_RESETBUF
int url_resetbuf(ByteIOContext *s, int flags)
#else
static int url_resetbuf(ByteIOContext *s, int flags)
#endif
{
-#if LIBAVFORMAT_VERSION_MAJOR < 53
+#if FF_API_URL_RESETBUF
if (flags & URL_RDWR)
return AVERROR(EINVAL);
#else