mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 15:02:56 +02:00
ffmpegdec: Fix system freeze at end of playback with ffmpeg 4.0+
This commit is contained in:
@@ -104,7 +104,15 @@ int CFfmpegDec::Read(void *buf, size_t buf_size)
|
||||
|
||||
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
|
||||
{
|
||||
#if LIBAVFORMAT_VERSION_MAJOR < 58
|
||||
return ((CFfmpegDec *) opaque)->Read(buf, (size_t) buf_size);
|
||||
#else
|
||||
// ffmpeg 4.0+: read_packet MUST return a valid AVERROR code instead of 0.
|
||||
int len = ((CFfmpegDec *) opaque)->Read(buf, (size_t) buf_size);
|
||||
if (len == 0)
|
||||
return AVERROR_EOF;
|
||||
return len;
|
||||
#endif
|
||||
}
|
||||
|
||||
int64_t CFfmpegDec::Seek(int64_t offset, int whence)
|
||||
|
Reference in New Issue
Block a user