lib/ffmpeg/IOContext: allow partial reads

This commit is contained in:
Max Kellermann 2019-03-13 10:39:43 +01:00
parent f6a705c769
commit bfb7b0117f
2 changed files with 4 additions and 2 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.22 (not yet released) ver 0.22 (not yet released)
* input
- ffmpeg: allow partial reads
ver 0.21.6 (not yet released) ver 0.21.6 (not yet released)
* protocol * protocol

View File

@ -71,8 +71,8 @@ public:
} }
size_t Read(void *buffer, size_t size) { size_t Read(void *buffer, size_t size) {
int result = avio_read(io_context, int result = avio_read_partial(io_context,
(unsigned char *)buffer, size); (unsigned char *)buffer, size);
if (result < 0) if (result < 0)
throw MakeFfmpegError(result, "avio_read() failed"); throw MakeFfmpegError(result, "avio_read() failed");