decoder/plugins/FfmpegIo: return AVERROR_EOF at end of file

This part of the AVIOContext API is not documented :-(

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1448
This commit is contained in:
Max Kellermann 2022-03-14 13:58:37 +01:00
parent 9975905faf
commit 8f84e1befd
2 changed files with 6 additions and 1 deletions

1
NEWS
View File

@ -1,5 +1,6 @@
ver 0.23.6 (not yet released)
* decoder
- ffmpeg: fix end-of-file check (update stuck at empty files)
- opus: fix "readpicture" on Opus files
* output
- pipewire: fix crash bug if setting volume before playback starts

View File

@ -35,7 +35,11 @@ AvioStream::~AvioStream()
inline int
AvioStream::Read(void *dest, int size)
{
return decoder_read(client, input, dest, size);
const auto nbytes = decoder_read(client, input, dest, size);
if (nbytes == 0)
return AVERROR_EOF;
return nbytes;
}
inline int64_t