Commit 1d436b3c authored by Max Kellermann's avatar Max Kellermann

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 bfb7b011 Closes https://github.com/MusicPlayerDaemon/MPD/issues/511
parent f86b14bf
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment