summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-10-01 20:11:40 +0200
committerCarl Hetherington <cth@carlh.net>2022-11-26 00:09:27 +0100
commitbc6fd8c020ad27c86c463876f76c8add042cb660 (patch)
treefab3c338985e46a7297149c2b35f4c2f487f96f3 /src/lib/ffmpeg.cc
parent8dfef0f38cc3323bc4a5d90c9102e8d3965496a4 (diff)
Return AVERROR_EOF from the avio_read method when appropriate.
Diffstat (limited to 'src/lib/ffmpeg.cc')
-rw-r--r--src/lib/ffmpeg.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc
index 6ec368ef6..39abfe2b8 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;
}