From b71a6641dd0efb591bd0299e624c213564f858ad Mon Sep 17 00:00:00 2001 From: lufi Date: Mon, 23 Jul 2018 21:19:48 -0400 Subject: [PATCH] checking if frame is null, seen it happen with gambatte which is why single threaded video didn't work --- Makefile.switch | 3 ++- gfx/drivers/switch_gfx.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile.switch b/Makefile.switch index 09aac65dad..601ae04b8e 100644 --- a/Makefile.switch +++ b/Makefile.switch @@ -89,7 +89,8 @@ APP_AUTHOR := M4xw, Credit: Reswitched, libretro #--------------------------------------------------------------------------------- # options for code generation #--------------------------------------------------------------------------------- -ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE +ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -mcpu=cortex-a57+crc+fp+simd + CFLAGS := -g -Wall -O3 -ffast-math -ffunction-sections \ $(ARCH) $(DEFINES) -Ideps -Ideps/libz -Ilibretro-common/include -Ideps/stb -I$(LIBNX)/include -include $(LIBNX)/include/switch.h $(shell $(DEVKITPRO)/portlibs/switch/bin/freetype-config --cflags) diff --git a/gfx/drivers/switch_gfx.c b/gfx/drivers/switch_gfx.c index 41be5857f4..a8f255be0a 100644 --- a/gfx/drivers/switch_gfx.c +++ b/gfx/drivers/switch_gfx.c @@ -316,13 +316,15 @@ static bool switch_frame(void *data, const void *frame, unsigned width, unsigned height, uint64_t frame_count, unsigned pitch, const char *msg, video_frame_info_t *video_info) - { unsigned x, y; uint32_t *out_buffer = NULL; switch_video_t *sw = data; bool ffwd_mode = video_info->input_driver_nonblock_state; + if (!frame) + return; + if (ffwd_mode && !sw->is_threaded) { // render every 4th frame when in ffwd mode and not threaded -- GitLab