From c78fe3e306a2300249a146e17eec8a31e4ccf7f3 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sat, 19 Apr 2014 06:33:11 -0700 Subject: [PATCH] obs-video.c: Fix minor bug The pointer here is confusing, so I'm just going to remove it and have it return the value instead. --- libobs/obs-video.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libobs/obs-video.c b/libobs/obs-video.c index a06ff2600..648d81fcb 100644 --- a/libobs/obs-video.c +++ b/libobs/obs-video.c @@ -20,21 +20,22 @@ #include "graphics/vec4.h" #include "media-io/format-conversion.h" -static void tick_sources(uint64_t cur_time, uint64_t *last_time) +static uint64_t tick_sources(uint64_t cur_time, uint64_t last_time) { size_t i; uint64_t delta_time; float seconds; if (!last_time) - *last_time = cur_time - video_getframetime(obs->video.video); - delta_time = cur_time - *last_time; + last_time = cur_time - video_getframetime(obs->video.video); + delta_time = cur_time - last_time; seconds = (float)((double)delta_time / 1000000000.0); for (i = 0; i < obs->data.sources.num; i++) obs_source_video_tick(obs->data.sources.array[i], seconds); - *last_time = cur_time; + last_time = cur_time; + return last_time; } /* in obs-display.c */ @@ -416,7 +417,7 @@ void *obs_video_thread(void *param) while (video_output_wait(obs->video.video)) { uint64_t cur_time = video_gettime(obs->video.video); - tick_sources(cur_time, &last_time); + last_time = tick_sources(cur_time, last_time); render_displays();