Skip to content

Commit

Permalink
MTROPOLIS: Handle videos that have no video frames
Browse files Browse the repository at this point in the history
In How To Build A Telemedicine Program, all the video files have no
video frames, and contain only audio. In this case, the QT player will
keep playing the video until the audio is finished. Handle such cases,
so that the game's UI is responsive
  • Loading branch information
bluegr committed Sep 21, 2024
1 parent 8f6ab97 commit e0608d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion engines/mtropolis/elements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,10 +846,11 @@ void MovieElement::playMedia(Runtime *runtime, Project *project) {
uint32 minTS = realRange.min;
uint32 maxTS = realRange.max;
uint32 targetTS = _currentTimestamp;
const bool hasFrames = _videoDecoder->getFrameCount() > 0;

int framesDecodedThisFrame = 0;
if (_currentPlayState == kMediaStatePlaying) {
while (_videoDecoder->needsUpdate()) {
while (_videoDecoder->needsUpdate() && hasFrames) {
if (_playEveryFrame && framesDecodedThisFrame > 0)
break;

Expand Down

0 comments on commit e0608d9

Please sign in to comment.