diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 4555769b7d..0b4084c054 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -798,3 +798,19 @@ void video_driver_get_video_output_prev(void) && driver->video_poke->get_video_output_prev) driver->video_poke->get_video_output_prev(driver->video_data); } + +bool video_driver_frame(const void *frame, unsigned width, + unsigned height, unsigned pitch, const char *msg) +{ + bool ret; + driver_t *driver = driver_get_ptr(); + runloop_t *runloop = rarch_main_get_ptr(); + if (driver && driver->video + && driver->video->frame(driver->video_data, + frame, width, height, pitch, msg)) + { + runloop->frames.video.count++; + return true; + } + return false; +} diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 5666e2e386..5298fdce2e 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -320,6 +320,9 @@ void video_driver_get_video_output_next(void); void video_driver_get_video_output_prev(void); +bool video_driver_frame(const void *frame, unsigned width, + unsigned height, unsigned pitch, const char *msg); + #ifdef __cplusplus } #endif diff --git a/libretro_version_1.c b/libretro_version_1.c index 308f52c5d5..3ea773ae8f 100644 --- a/libretro_version_1.c +++ b/libretro_version_1.c @@ -119,7 +119,6 @@ static void video_frame(const void *data, unsigned width, { unsigned output_width = 0, output_height = 0, output_pitch = 0; const char *msg = NULL; - runloop_t *runloop = rarch_main_get_ptr(); driver_t *driver = driver_get_ptr(); global_t *global = global_get_ptr(); settings_t *settings = config_get_ptr(); @@ -160,13 +159,8 @@ static void video_frame(const void *data, unsigned width, pitch = output_pitch; } - if (driver->video->frame(driver->video_data, data, width, height, pitch, msg)) - { - runloop->frames.video.count++; - return; - } - - driver->video_active = false; + if (!video_driver_frame(data, width, height, pitch, msg)) + driver->video_active = false; } /**