From e6373f28697ee76a847d5810a34a2317509ecc35 Mon Sep 17 00:00:00 2001 From: LibretroAdmin Date: Sat, 28 Dec 2024 00:33:40 +0100 Subject: [PATCH] Position Latency accurately in statistics --- gfx/video_driver.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 84ea4cc1738..bc04e761758 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -4118,9 +4118,8 @@ void video_driver_frame(const void *data, unsigned width, { /* TODO/FIXME - localize */ - size_t __len = strlcpy(video_info.stat_text, "LATENCY\n", sizeof(video_info.stat_text)); - __len += snprintf(video_info.stat_text + __len, - sizeof(video_info.stat_text) - __len, + size_t __len = snprintf(video_info.stat_text, + sizeof(video_info.stat_text), "CORE AV_INFO\n" " Size: %u x %u\n" " - Base: %u x %u\n" @@ -4175,6 +4174,13 @@ void video_driver_frame(const void *data, unsigned width, audio_stats.samples ); + + /* TODO/FIXME - localize */ + if ( (video_st->frame_delay_target > 0) + || (video_info.runahead && !video_info.runahead_second_instance)) + __len += strlcpy(video_info.stat_text + __len, "LATENCY\n", + sizeof(video_info.stat_text - __len)); + /* TODO/FIXME - localize */ if (video_st->frame_delay_target > 0) __len += snprintf(video_info.stat_text + __len, sizeof(video_info.stat_text) - __len,