mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-31 04:25:40 +00:00
Fixed an issue where the video player would not play the last couple of frames for any videos
This commit is contained in:
parent
fd955d5a6e
commit
89d94bc1b0
|
@ -58,6 +58,7 @@ VideoFFmpegComponent::VideoFFmpegComponent()
|
||||||
, mAccumulatedTime {0.0l}
|
, mAccumulatedTime {0.0l}
|
||||||
, mStartTimeAccumulation {false}
|
, mStartTimeAccumulation {false}
|
||||||
, mDecodedFrame {false}
|
, mDecodedFrame {false}
|
||||||
|
, mReadAllFrames {false}
|
||||||
, mEndOfVideo {false}
|
, mEndOfVideo {false}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -761,7 +762,7 @@ void VideoFFmpegComponent::readFrames()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (readFrameReturn < 0)
|
if (readFrameReturn < 0)
|
||||||
mEndOfVideo = true;
|
mReadAllFrames = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoFFmpegComponent::getProcessedFrames()
|
void VideoFFmpegComponent::getProcessedFrames()
|
||||||
|
@ -974,6 +975,9 @@ void VideoFFmpegComponent::outputFrames()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mReadAllFrames && mVideoFrameQueue.empty())
|
||||||
|
mEndOfVideo = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoFFmpegComponent::calculateBlackRectangle()
|
void VideoFFmpegComponent::calculateBlackRectangle()
|
||||||
|
@ -1341,6 +1345,7 @@ void VideoFFmpegComponent::startVideoStream()
|
||||||
mStartTimeAccumulation = false;
|
mStartTimeAccumulation = false;
|
||||||
mSWDecoder = true;
|
mSWDecoder = true;
|
||||||
mDecodedFrame = false;
|
mDecodedFrame = false;
|
||||||
|
mReadAllFrames = false;
|
||||||
mEndOfVideo = false;
|
mEndOfVideo = false;
|
||||||
mVideoFrameCount = 0;
|
mVideoFrameCount = 0;
|
||||||
mAudioFrameCount = 0;
|
mAudioFrameCount = 0;
|
||||||
|
@ -1558,6 +1563,7 @@ void VideoFFmpegComponent::stopVideoPlayer(bool muteAudio)
|
||||||
mIsPlaying = false;
|
mIsPlaying = false;
|
||||||
mIsActuallyPlaying = false;
|
mIsActuallyPlaying = false;
|
||||||
mPaused = false;
|
mPaused = false;
|
||||||
|
mReadAllFrames = false;
|
||||||
mEndOfVideo = false;
|
mEndOfVideo = false;
|
||||||
mTexture.reset();
|
mTexture.reset();
|
||||||
|
|
||||||
|
|
|
@ -176,6 +176,7 @@ private:
|
||||||
std::atomic<double> mAccumulatedTime;
|
std::atomic<double> mAccumulatedTime;
|
||||||
std::atomic<bool> mStartTimeAccumulation;
|
std::atomic<bool> mStartTimeAccumulation;
|
||||||
std::atomic<bool> mDecodedFrame;
|
std::atomic<bool> mDecodedFrame;
|
||||||
|
std::atomic<bool> mReadAllFrames;
|
||||||
std::atomic<bool> mEndOfVideo;
|
std::atomic<bool> mEndOfVideo;
|
||||||
bool mSWDecoder;
|
bool mSWDecoder;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue