Merge branch 'ffmpeg5' into 'master'

fix hang with ffmpeg5 (ffmpeg_decoder: signal EOF/errors on readPacket)

Closes #6631

See merge request OpenMW/openmw!1941
CPP20
psi29a 2 years ago
commit 436db8c0e5

@ -109,6 +109,7 @@
Bug #6606: Quests with multiple IDs cannot always be restarted
Bug #6653: With default settings the in-game console doesn't fit into screen
Bug #6655: Constant effect absorb attribute causes the game to break
Bug #6631: Fix ffmpeg avio API usage causing hangs in ffmpeg version 5
Bug #6667: Pressing the Esc key while resting or waiting causes black screen.
Bug #6670: Dialogue order is incorrect
Bug #6680: object.cpp handles nodetree unsafely, memory access with dangling pointer

@ -18,11 +18,14 @@ int FFmpeg_Decoder::readPacket(void *user_data, uint8_t *buf, int buf_size)
std::istream& stream = *static_cast<FFmpeg_Decoder*>(user_data)->mDataStream;
stream.clear();
stream.read((char*)buf, buf_size);
return stream.gcount();
std::streamsize count = stream.gcount();
if (count == 0)
return AVERROR_EOF;
return count;
}
catch (std::exception& )
{
return 0;
return AVERROR_UNKNOWN;
}
}

Loading…
Cancel
Save