From 3276781b4f8161fd6e876b09dcbc871999ee8ec3 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 7 Mar 2015 13:28:45 +0100 Subject: [PATCH] Don't increment g_runloop.frames.video.count inside video driver implementation's 'frame' function - do this outside --- gfx/drivers/exynos_gfx.c | 2 -- gfx/drivers/gl.c | 2 -- gfx/drivers/gx_gfx.c | 2 -- gfx/drivers/omap_gfx.c | 2 -- gfx/drivers/psp1_gfx.c | 2 -- gfx/drivers/sdl2_gfx.c | 2 -- gfx/drivers/sdl_gfx.c | 1 - gfx/drivers/xvideo.c | 1 - gfx/drivers_context/d3d_ctx.cpp | 4 ---- libretro_version_1.c | 9 +++++++-- 10 files changed, 7 insertions(+), 20 deletions(-) diff --git a/gfx/drivers/exynos_gfx.c b/gfx/drivers/exynos_gfx.c index 5eece59229..51f4a05b75 100644 --- a/gfx/drivers/exynos_gfx.c +++ b/gfx/drivers/exynos_gfx.c @@ -1461,8 +1461,6 @@ static bool exynos_gfx_frame(void *data, const void *frame, unsigned width, if (exynos_flip(vid->data, page) != 0) goto fail; - g_runloop.frames.video.count++; - return true; fail: diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index b518357554..f8aaffdf00 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -1681,8 +1681,6 @@ static bool gl_frame(void *data, const void *frame, context_bind_hw_render(gl, true); - g_runloop.frames.video.count++; - return true; } diff --git a/gfx/drivers/gx_gfx.c b/gfx/drivers/gx_gfx.c index ef4c6b8ada..18f0942aca 100644 --- a/gfx/drivers/gx_gfx.c +++ b/gfx/drivers/gx_gfx.c @@ -1149,8 +1149,6 @@ static bool gx_frame(void *data, const void *frame, VISetNextFrameBuffer(g_framebuf[g_current_framebuf]); VIFlush(); - g_runloop.frames.video.count++; - RARCH_PERFORMANCE_STOP(gx_frame); return true; diff --git a/gfx/drivers/omap_gfx.c b/gfx/drivers/omap_gfx.c index 4f5cf02ed0..cb49228751 100644 --- a/gfx/drivers/omap_gfx.c +++ b/gfx/drivers/omap_gfx.c @@ -1000,8 +1000,6 @@ static bool omap_gfx_frame(void *data, const void *frame, unsigned width, if (msg) omap_render_msg(vid, msg); - g_runloop.frames.video.count++; - return true; } diff --git a/gfx/drivers/psp1_gfx.c b/gfx/drivers/psp1_gfx.c index 36fa5ce81f..d374fa5201 100644 --- a/gfx/drivers/psp1_gfx.c +++ b/gfx/drivers/psp1_gfx.c @@ -527,8 +527,6 @@ static bool psp_frame(void *data, const void *frame, #endif psp->draw_buffer = FROM_GU_POINTER(sceGuSwapBuffers()); - g_runloop.frames.video.count++; - RARCH_PERFORMANCE_INIT(psp_frame_run); RARCH_PERFORMANCE_START(psp_frame_run); diff --git a/gfx/drivers/sdl2_gfx.c b/gfx/drivers/sdl2_gfx.c index 4aa93c48c8..db262a9b02 100644 --- a/gfx/drivers/sdl2_gfx.c +++ b/gfx/drivers/sdl2_gfx.c @@ -517,8 +517,6 @@ static bool sdl2_gfx_frame(void *data, const void *frame, unsigned width, if (video_monitor_get_fps(buf, sizeof(buf), NULL, 0)) SDL_SetWindowTitle(vid->window, buf); - g_runloop.frames.video.count++; - return true; } diff --git a/gfx/drivers/sdl_gfx.c b/gfx/drivers/sdl_gfx.c index 881b0e5083..8c177d4577 100644 --- a/gfx/drivers/sdl_gfx.c +++ b/gfx/drivers/sdl_gfx.c @@ -376,7 +376,6 @@ static bool sdl_gfx_frame(void *data, const void *frame, unsigned width, SDL_WM_SetCaption(buf, NULL); SDL_Flip(vid->screen); - g_runloop.frames.video.count++; return true; } diff --git a/gfx/drivers/xvideo.c b/gfx/drivers/xvideo.c index 3c3c9863f0..9aa0f00f59 100644 --- a/gfx/drivers/xvideo.c +++ b/gfx/drivers/xvideo.c @@ -775,7 +775,6 @@ static bool xv_frame(void *data, const void *frame, unsigned width, if (video_monitor_get_fps(buf, sizeof(buf), NULL, 0)) XStoreName(xv->display, xv->window, buf); - g_runloop.frames.video.count++; return true; } diff --git a/gfx/drivers_context/d3d_ctx.cpp b/gfx/drivers_context/d3d_ctx.cpp index ed5a23eb84..dc2c5cf67e 100644 --- a/gfx/drivers_context/d3d_ctx.cpp +++ b/gfx/drivers_context/d3d_ctx.cpp @@ -147,10 +147,6 @@ static void gfx_ctx_d3d_update_title(void *data) #endif msg_queue_push(g_runloop.msg_queue, buffer_fps, 1, 1); } - -#ifndef _XBOX - g_runloop.frames.video.count++; -#endif } static void gfx_ctx_d3d_show_mouse(void *data, bool state) diff --git a/libretro_version_1.c b/libretro_version_1.c index 6180a83cd5..635673867e 100644 --- a/libretro_version_1.c +++ b/libretro_version_1.c @@ -148,8 +148,13 @@ static void video_frame(const void *data, unsigned width, pitch = output_pitch; } - if (!driver.video->frame(driver.video_data, data, width, height, pitch, msg)) - driver.video_active = false; + if (driver.video->frame(driver.video_data, data, width, height, pitch, msg)) + { + g_runloop.frames.video.count++; + return; + } + + driver.video_active = false; } /**