X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg.cc;h=8220962d64d27077428b773f0df28ff44bd53377;hb=f583e13fe48e8b6cf4f3f9195fd31b603bc41fc2;hp=6c8509b6cd71de2eef9e5a75e3c58b2e9f1cd87f;hpb=be486380a15a9e444c761384cd6c60e77def909f;p=dcpomatic.git 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; }