From f583e13fe48e8b6cf4f3f9195fd31b603bc41fc2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 1 Oct 2022 20:11:40 +0200 Subject: Return AVERROR_EOF from the avio_read method when appropriate. --- src/lib/ffmpeg.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/lib/ffmpeg.cc') diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc index 6c8509b6c..8220962d6 100644 --- a/src/lib/ffmpeg.cc +++ b/src/lib/ffmpeg.cc @@ -273,7 +273,11 @@ FFmpeg::subtitle_codec_context () const int FFmpeg::avio_read (uint8_t* buffer, int const amount) { - return _file_group.read (buffer, amount); + auto result = _file_group.read(buffer, amount); + if (result.eof && result.bytes_read == 0) { + return AVERROR_EOF; + } + return result.bytes_read; } -- cgit v1.2.3