From 3ea23320b83178cb83013dc1e27930ef1f04cc0e Mon Sep 17 00:00:00 2001 From: jp9000 Date: Tue, 3 Oct 2017 18:48:12 -0700 Subject: [PATCH] libobs: Initialize randomization seed in video thread Ensures that any rand() calls in the video thread will have a unique seed to start from. --- libobs/obs-video.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libobs/obs-video.c b/libobs/obs-video.c index f975f74ac..691ed08b3 100644 --- a/libobs/obs-video.c +++ b/libobs/obs-video.c @@ -15,6 +15,9 @@ along with this program. If not, see . ******************************************************************************/ +#include +#include + #include "obs.h" #include "obs-internal.h" #include "graphics/vec4.h" @@ -599,6 +602,8 @@ void *obs_video_thread(void *param) "obs_video_thread(%g"NBSP"ms)", interval / 1000000.); profile_register_root(video_thread_name, interval); + srand((unsigned int)time(NULL)); + while (!video_output_stopped(obs->video.video)) { uint64_t frame_start = os_gettime_ns(); uint64_t frame_time_ns; -- GitLab