Revision 468644f6

View differences:

libavformat/avio.h
542 542
int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
543 543

  
544 544

  
545
#if FF_API_URL_RESETBUF
546
/** Reset the buffer for reading or writing.
547
 * @note Will drop any data currently in the buffer without transmitting it.
548
 * @param flags URL_RDONLY to set up the buffer for reading, or URL_WRONLY
549
 *        to set up the buffer for writing. */
550
int url_resetbuf(AVIOContext *s, int flags);
551
#endif
552

  
553 545
/**
554 546
 * @defgroup open_modes URL open modes
555 547
 * The flags argument to avio_open must be one of the following
libavformat/aviobuf.c
38 38
#define SHORT_SEEK_THRESHOLD 4096
39 39

  
40 40
static void fill_buffer(AVIOContext *s);
41
#if !FF_API_URL_RESETBUF
42 41
static int url_resetbuf(AVIOContext *s, int flags);
43
#endif
44 42

  
45 43
int ffio_init_context(AVIOContext *s,
46 44
                  unsigned char *buffer,
......
878 876
    return 0;
879 877
}
880 878

  
881
#if FF_API_URL_RESETBUF
882
int url_resetbuf(AVIOContext *s, int flags)
883
#else
884 879
static int url_resetbuf(AVIOContext *s, int flags)
885
#endif
886 880
{
887
#if FF_API_URL_RESETBUF
888
    if (flags & AVIO_RDWR)
889
        return AVERROR(EINVAL);
890
#else
891 881
    assert(flags == AVIO_WRONLY || flags == AVIO_RDONLY);
892
#endif
893 882

  
894 883
    if (flags & AVIO_WRONLY) {
895 884
        s->buf_end = s->buffer + s->buffer_size;
libavformat/version.h
47 47
#ifndef FF_API_URL_CLASS
48 48
#define FF_API_URL_CLASS               (LIBAVFORMAT_VERSION_MAJOR >= 53)
49 49
#endif
50
#ifndef FF_API_URL_RESETBUF
51
#define FF_API_URL_RESETBUF            (LIBAVFORMAT_VERSION_MAJOR < 53)
52
#endif
53 50
#ifndef FF_API_REGISTER_PROTOCOL
54 51
#define FF_API_REGISTER_PROTOCOL       (LIBAVFORMAT_VERSION_MAJOR < 53)
55 52
#endif

Also available in: Unified diff