0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-19 20:32:15 +02:00

libobs: Initialize randomization seed in video thread

Ensures that any rand() calls in the video thread will have a unique
seed to start from.
This commit is contained in:
jp9000 2017-10-03 18:48:12 -07:00
parent e5d660e944
commit 3ea23320b8

View File

@ -15,6 +15,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#include <time.h>
#include <stdlib.h>
#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;