summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-09-01 17:59:03 +0200
committerwm4 <wm4@nowhere>2017-09-01 17:59:03 +0200
commit449d9725c91af467b154817dfd0603d80ba7f00b (patch)
tree329e567f2ea9de03d73c5ec0d49f82ef838369a9
parent9f0e3588279ef343383f6d7a39099a5e92cc6963 (diff)
downloadmpv-449d9725c91af467b154817dfd0603d80ba7f00b.tar.bz2
mpv-449d9725c91af467b154817dfd0603d80ba7f00b.tar.xz
stream_lavf: use avio_read_partial()
Possibly improves latency and such things.
-rw-r--r--stream/stream_lavf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/stream/stream_lavf.c b/stream/stream_lavf.c
index dec8d4b277..80a27bd3e6 100644
--- a/stream/stream_lavf.c
+++ b/stream/stream_lavf.c
@@ -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;
}