From 2dfe441381400dfac8d5fc41a4d058de88dd41d8 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 23 Apr 2017 19:21:12 +0200 Subject: [PATCH] Get rid of video_info->frame_count --- gfx/video_driver.c | 18 +++++++----------- gfx/video_driver.h | 1 - 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 5852e7c5ce..93b175985f 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -2064,13 +2064,8 @@ void video_driver_frame(const void *data, unsigned width, video_driver_build_info(&video_info); - video_driver_threaded_lock(); - video_info.frame_count = video_driver_frame_count; - video_driver_frame_count++; - video_driver_threaded_unlock(); - /* Get the amount of frames per seconds. */ - if (video_info.frame_count) + if (video_driver_frame_count) { unsigned write_index = video_driver_frame_time_count++ & @@ -2078,7 +2073,7 @@ void video_driver_frame(const void *data, unsigned width, video_driver_frame_time_samples[write_index] = new_time - fps_time; fps_time = new_time; - if ((video_info.frame_count % FPS_UPDATE_INTERVAL) == 0) + if ((video_driver_frame_count % FPS_UPDATE_INTERVAL) == 0) { char frames_text[64]; @@ -2107,7 +2102,7 @@ void video_driver_frame(const void *data, unsigned width, snprintf(frames_text, sizeof(frames_text), STRING_REP_UINT64, - (unsigned long long)video_info.frame_count); + (unsigned long long)video_driver_frame_count); strlcat(video_driver_window_title, frames_text, @@ -2123,7 +2118,7 @@ void video_driver_frame(const void *data, unsigned width, "FPS: %6.1f || %s: " STRING_REP_UINT64, last_fps, msg_hash_to_str(MSG_FRAMES), - (unsigned long long)video_info.frame_count); + (unsigned long long)video_driver_frame_count); } else { @@ -2175,10 +2170,12 @@ void video_driver_frame(const void *data, unsigned width, if (!current_video || !current_video->frame( video_driver_data, data, width, height, - video_info.frame_count, + video_driver_frame_count, (unsigned)pitch, video_driver_msg, &video_info)) video_driver_active = false; + video_driver_frame_count++; + if (video_info.fps_show) runloop_msg_queue_push(video_info.fps_text, 1, 1, false); } @@ -2267,7 +2264,6 @@ void video_driver_build_info(video_frame_info_t *video_info) video_info->font_msg_color_g = settings->video.msg_color_g; video_info->font_msg_color_b = settings->video.msg_color_b; - video_info->frame_count = 0; video_info->fps_text[0] = '\0'; video_info->width = video_driver_width; diff --git a/gfx/video_driver.h b/gfx/video_driver.h index a7a790353c..34adede943 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -128,7 +128,6 @@ typedef struct video_frame_info unsigned monitor_index; bool font_enable; char fps_text[128]; - uint64_t frame_count; unsigned width; unsigned height;