mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-22 10:41:21 +00:00
Redefine behavior of NULL in video_frame().
This commit is contained in:
parent
83c60aa94e
commit
9f60e48a98
@ -177,6 +177,9 @@ static void video_ext_set_nonblock_state(void *data, bool state)
|
||||
|
||||
static bool video_ext_frame(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch, const char *msg)
|
||||
{
|
||||
if (!frame)
|
||||
return true;
|
||||
|
||||
ext_t *ext = (ext_t*)data;
|
||||
return ext->driver->frame(ext->handle, frame, width, height, pitch, msg);
|
||||
}
|
||||
|
8
gfx/gl.c
8
gfx/gl.c
@ -897,9 +897,11 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei
|
||||
gl_update_resize(gl);
|
||||
}
|
||||
|
||||
gl_update_input_size(gl, width, height, pitch);
|
||||
|
||||
gl_copy_frame(gl, frame, width, height, pitch);
|
||||
if (frame) // Can be NULL for frame dupe / NULL render.
|
||||
{
|
||||
gl_update_input_size(gl, width, height, pitch);
|
||||
gl_copy_frame(gl, frame, width, height, pitch);
|
||||
}
|
||||
|
||||
struct gl_tex_info tex_info = {0};
|
||||
tex_info.tex = gl->texture[gl->tex_index];
|
||||
|
@ -470,6 +470,9 @@ static void check_window(sdl_video_t *vid)
|
||||
|
||||
static bool sdl_gfx_frame(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch, const char *msg)
|
||||
{
|
||||
if (!frame)
|
||||
return true;
|
||||
|
||||
sdl_video_t *vid = (sdl_video_t*)data;
|
||||
|
||||
if (SDL_MUSTLOCK(vid->buffer))
|
||||
|
@ -700,6 +700,9 @@ static void xv_render_msg(xv_t *xv, const char *msg, unsigned width, unsigned he
|
||||
|
||||
static bool xv_frame(void *data, const void *frame, unsigned width, unsigned height, unsigned pitch, const char *msg)
|
||||
{
|
||||
if (!frame)
|
||||
return true;
|
||||
|
||||
xv_t *xv = (xv_t*)data;
|
||||
|
||||
if (!check_resize(xv, width, height))
|
||||
|
16
retroarch.c
16
retroarch.c
@ -198,27 +198,23 @@ static void video_frame(const void *data, unsigned width, unsigned height, size_
|
||||
|
||||
// Slightly messy code,
|
||||
// but we really need to do processing before blocking on VSync for best possible scheduling.
|
||||
bool is_dupe = !data;
|
||||
#ifdef HAVE_FFMPEG
|
||||
|
||||
if (g_extern.recording && (!g_extern.filter.active || !g_settings.video.post_filter_record || is_dupe))
|
||||
if (g_extern.recording && (!g_extern.filter.active || !g_settings.video.post_filter_record || !data))
|
||||
{
|
||||
struct ffemu_video_data ffemu_data = {0};
|
||||
ffemu_data.data = data;
|
||||
ffemu_data.pitch = pitch;
|
||||
ffemu_data.width = width;
|
||||
ffemu_data.height = height;
|
||||
ffemu_data.is_dupe = is_dupe;
|
||||
ffemu_data.is_dupe = !data;
|
||||
ffemu_push_video(g_extern.rec, &ffemu_data);
|
||||
}
|
||||
#endif
|
||||
if (is_dupe)
|
||||
return;
|
||||
|
||||
const char *msg = msg_queue_pull(g_extern.msg_queue);
|
||||
|
||||
#ifdef HAVE_DYLIB
|
||||
if (g_extern.filter.active)
|
||||
if (g_extern.filter.active && data)
|
||||
{
|
||||
unsigned owidth = width;
|
||||
unsigned oheight = height;
|
||||
@ -248,10 +244,10 @@ static void video_frame(const void *data, unsigned width, unsigned height, size_
|
||||
g_extern.video_active = false;
|
||||
#endif
|
||||
|
||||
g_extern.frame_cache.data = data;
|
||||
g_extern.frame_cache.width = width;
|
||||
g_extern.frame_cache.data = data;
|
||||
g_extern.frame_cache.width = width;
|
||||
g_extern.frame_cache.height = height;
|
||||
g_extern.frame_cache.pitch = pitch;
|
||||
g_extern.frame_cache.pitch = pitch;
|
||||
}
|
||||
|
||||
#ifdef HAVE_GRIFFIN
|
||||
|
Loading…
x
Reference in New Issue
Block a user