Revision b3db9cee

View differences:

libavformat/avio.h
385 385
 * @{
386 386
 */
387 387
attribute_deprecated int          get_buffer(AVIOContext *s, unsigned char *buf, int size);
388
attribute_deprecated int          get_partial_buffer(AVIOContext *s, unsigned char *buf, int size);
388 389
attribute_deprecated int          get_byte(AVIOContext *s);
389 390
attribute_deprecated unsigned int get_le16(AVIOContext *s);
390 391
attribute_deprecated unsigned int get_le24(AVIOContext *s);
......
498 499
 */
499 500
int avio_read(AVIOContext *s, unsigned char *buf, int size);
500 501

  
501
/**
502
 * Read size bytes from AVIOContext into buf.
503
 * This reads at most 1 packet. If that is not enough fewer bytes will be
504
 * returned.
505
 * @return number of bytes read or AVERROR
506
 */
507
int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size);
508

  
509 502
/** @note return 0 if EOF, so you cannot use it if EOF handling is
510 503
    necessary */
511 504
int          avio_r8  (AVIOContext *s);
libavformat/avio_internal.h
32 32
                  int64_t (*seek)(void *opaque, int64_t offset, int whence));
33 33

  
34 34

  
35
/**
36
 * Read size bytes from AVIOContext into buf.
37
 * This reads at most 1 packet. If that is not enough fewer bytes will be
38
 * returned.
39
 * @return number of bytes read or AVERROR
40
 */
41
int ffio_read_partial(AVIOContext *s, unsigned char *buf, int size);
42

  
35 43
#endif // AVFORMAT_AVIO_INTERNAL_H
libavformat/aviobuf.c
324 324
{
325 325
    return avio_read(s, buf, size);
326 326
}
327
int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size)
328
{
329
    return ffio_read_partial(s, buf, size);
330
}
327 331
#endif
328 332

  
329 333
int avio_put_str(AVIOContext *s, const char *str)
......
548 552
    return size1 - size;
549 553
}
550 554

  
551
int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size)
555
int ffio_read_partial(AVIOContext *s, unsigned char *buf, int size)
552 556
{
553 557
    int len;
554 558

  
libavformat/rawdec.c
21 21
 */
22 22

  
23 23
#include "avformat.h"
24
#include "avio_internal.h"
24 25
#include "rawdec.h"
25 26

  
26 27
/* raw input */
......
81 82

  
82 83
    pkt->pos= url_ftell(s->pb);
83 84
    pkt->stream_index = 0;
84
    ret = get_partial_buffer(s->pb, pkt->data, size);
85
    ret = ffio_read_partial(s->pb, pkt->data, size);
85 86
    if (ret < 0) {
86 87
        av_free_packet(pkt);
87 88
        return ret;

Also available in: Unified diff