diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-10-01 20:11:40 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-10-12 09:40:36 +0200 |
| commit | 5c3e10e42031776a21032dfeb07bd8992a0955a2 (patch) | |
| tree | cb6e984a8a7e3deea38cf2a1d08308b1425505ca /src/lib/ffmpeg.cc | |
| parent | 285fc9b2f1c1e2a42b1adaf4b39a3317b296d30e (diff) | |
Return AVERROR_EOF from the avio_read method when appropriate.
Diffstat (limited to 'src/lib/ffmpeg.cc')
| -rw-r--r-- | src/lib/ffmpeg.cc | 6 |
1 files changed, 5 insertions, 1 deletions
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; } |
