mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Prevent crashing the emu in stepVideo when things have gone very wrong.
This commit is contained in:
parent
df6199d353
commit
04d24012e1
1 changed files with 5 additions and 1 deletions
|
@ -332,7 +332,7 @@ bool MediaEngine::setVideoDim(int width, int height)
|
|||
void MediaEngine::updateSwsFormat(int videoPixelMode) {
|
||||
#ifdef USE_FFMPEG
|
||||
AVPixelFormat swsDesired = getSwsFormat(videoPixelMode);
|
||||
if (swsDesired != m_sws_fmt) {
|
||||
if (swsDesired != m_sws_fmt && m_pCodecCtx != 0) {
|
||||
m_sws_fmt = swsDesired;
|
||||
m_sws_ctx = sws_getCachedContext
|
||||
(
|
||||
|
@ -353,6 +353,10 @@ void MediaEngine::updateSwsFormat(int videoPixelMode) {
|
|||
}
|
||||
|
||||
bool MediaEngine::stepVideo(int videoPixelMode) {
|
||||
if (!m_pFormatCtx)
|
||||
return false;
|
||||
if (!m_pCodecCtx)
|
||||
return false;
|
||||
|
||||
// if video engine is broken, force to add timestamp
|
||||
m_videopts += 3003;
|
||||
|
|
Loading…
Add table
Reference in a new issue