mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 04:42:18 +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:
parent
e5d660e944
commit
3ea23320b8
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user