Merge pull request #12647 from jdgleaver/dingux-frameskip-fix

(Dingux) Fix display when cores 'drop' frames
This commit is contained in:
Autechre 2021-07-13 21:42:02 +02:00 committed by GitHub
commit b644a37622
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 11 deletions

View File

@ -762,7 +762,13 @@ static bool sdl_dingux_gfx_frame(void *data, const void *frame,
{
sdl_dingux_video_t* vid = (sdl_dingux_video_t*)data;
if (unlikely(!vid))
/* Return early if:
* - Input sdl_dingux_video_t struct is NULL
* (cannot realistically happen)
* - Menu is inactive and input 'content' frame
* data is NULL (may happen when e.g. a running
* core skips a frame) */
if (unlikely(!vid || (!frame && !vid->menu_active)))
return true;
/* If fast forward is currently active, we may
@ -806,16 +812,13 @@ static bool sdl_dingux_gfx_frame(void *data, const void *frame,
if (likely(vid->mode_valid))
{
if (likely(frame))
{
/* Blit frame to SDL surface */
if (vid->rgb32)
sdl_dingux_blit_frame32(vid, (uint32_t*)frame,
width, height, pitch);
else
sdl_dingux_blit_frame16(vid, (uint16_t*)frame,
width, height, pitch);
}
/* Blit frame to SDL surface */
if (vid->rgb32)
sdl_dingux_blit_frame32(vid, (uint32_t*)frame,
width, height, pitch);
else
sdl_dingux_blit_frame16(vid, (uint16_t*)frame,
width, height, pitch);
}
/* If current display mode is invalid,
* just display an error message */