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:
parent
f86b14bfc5
commit
1d436b3c86
@ -76,8 +76,13 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t Read(void *buffer, size_t size) {
|
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,
|
int result = avio_read_partial(io_context,
|
||||||
(unsigned char *)buffer, size);
|
(unsigned char *)buffer, size);
|
||||||
|
#else
|
||||||
|
int result = avio_read(io_context,
|
||||||
|
(unsigned char *)buffer, size);
|
||||||
|
#endif
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
throw MakeFfmpegError(result, "avio_read() failed");
|
throw MakeFfmpegError(result, "avio_read() failed");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user