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 bfb7b0117f

Closes https://github.com/MusicPlayerDaemon/MPD/issues/511
This commit is contained in:
Max Kellermann 2019-03-20 13:15:05 +01:00
parent f86b14bfc5
commit 1d436b3c86

View File

@ -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");