Revision e74c01db libavformat/utils.c
libavformat/utils.c | ||
---|---|---|
524 | 524 |
#define PROBE_BUF_MIN 2048 |
525 | 525 |
#define PROBE_BUF_MAX (1<<20) |
526 | 526 |
|
527 |
int ff_probe_input_buffer(ByteIOContext **pb, AVInputFormat **fmt,
|
|
527 |
int ff_probe_input_buffer(ByteIOContext *pb, AVInputFormat **fmt, |
|
528 | 528 |
const char *filename, void *logctx, |
529 | 529 |
unsigned int offset, unsigned int max_probe_size) |
530 | 530 |
{ |
... | ... | |
555 | 555 |
|
556 | 556 |
/* read probe data */ |
557 | 557 |
buf = av_realloc(buf, probe_size + AVPROBE_PADDING_SIZE); |
558 |
if ((ret = get_buffer(*pb, buf + buf_offset, probe_size - buf_offset)) < 0) {
|
|
558 |
if ((ret = get_buffer(pb, buf + buf_offset, probe_size - buf_offset)) < 0) { |
|
559 | 559 |
/* fail if error was not end of file, otherwise, lower score */ |
560 | 560 |
if (ret != AVERROR_EOF) { |
561 | 561 |
av_free(buf); |
... | ... | |
585 | 585 |
} |
586 | 586 |
|
587 | 587 |
/* rewind. reuse probe buffer to avoid seeking */ |
588 |
if ((ret = ff_rewind_with_probe_data(*pb, buf, pd.buf_size)) < 0)
|
|
588 |
if ((ret = ff_rewind_with_probe_data(pb, buf, pd.buf_size)) < 0) |
|
589 | 589 |
av_free(buf); |
590 | 590 |
|
591 | 591 |
return ret; |
... | ... | |
622 | 622 |
if (buf_size > 0) { |
623 | 623 |
url_setbufsize(pb, buf_size); |
624 | 624 |
} |
625 |
if (!fmt && (err = ff_probe_input_buffer(&pb, &fmt, filename, logctx, 0, logctx ? (*ic_ptr)->probesize : 0)) < 0) {
|
|
625 |
if (!fmt && (err = ff_probe_input_buffer(pb, &fmt, filename, logctx, 0, logctx ? (*ic_ptr)->probesize : 0)) < 0) { |
|
626 | 626 |
goto fail; |
627 | 627 |
} |
628 | 628 |
} |
Also available in: Unified diff