stream_lavf: use avio_read_partial()

Possibly improves latency and such things.
This commit is contained in:
wm4 2017-09-01 17:59:03 +02:00
parent 9f0e358827
commit 449d9725c9
1 changed files with 4 additions and 0 deletions

View File

@ -79,7 +79,11 @@ static int fill_buffer(stream_t *s, char *buffer, int max_len)
AVIOContext *avio = s->priv;
if (!avio)
return -1;
#if LIBAVFORMAT_VERSION_MICRO >= 100 && LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 81, 100)
int r = avio_read_partial(avio, buffer, max_len);
#else
int r = avio_read(avio, buffer, max_len);
#endif
return (r <= 0) ? -1 : r;
}