From 1d436b3c866d6fa4837d8392630491c117789fb5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 20 Mar 2019 13:15:05 +0100 Subject: [PATCH] lib/ffmpeg/IOContext: keep using avio_read() with old libavformat versions avio_read_partial() was added in libavformat 57.81.100, and we keep compatibility with version 57.40 for now. Fixes regression from commit bfb7b0117fb4d Closes https://github.com/MusicPlayerDaemon/MPD/issues/511 --- src/lib/ffmpeg/IOContext.hxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/ffmpeg/IOContext.hxx b/src/lib/ffmpeg/IOContext.hxx index 6530f3568..54a602227 100644 --- a/src/lib/ffmpeg/IOContext.hxx +++ b/src/lib/ffmpeg/IOContext.hxx @@ -76,8 +76,13 @@ public: } size_t Read(void *buffer, size_t size) { +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 81, 100) int result = avio_read_partial(io_context, (unsigned char *)buffer, size); +#else + int result = avio_read(io_context, + (unsigned char *)buffer, size); +#endif if (result < 0) throw MakeFfmpegError(result, "avio_read() failed");