Skip to content

Commit 30fcba6

Browse files
committed
Fix output type and frame rate divisor for mac and linux
1 parent 8aeff93 commit 30fcba6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

source-record.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
#include "version.h"
88
#include "obs-websocket-api.h"
99

10+
#ifndef _WIN32
11+
#include <dlfcn.h>
12+
#endif
13+
1014
#define OUTPUT_MODE_NONE 0
1115
#define OUTPUT_MODE_ALWAYS 1
1216
#define OUTPUT_MODE_STREAMING 2
@@ -501,7 +505,11 @@ static void start_stream_output(struct source_record_filter_context *filter, obs
501505
obs_service_apply_encoder_settings(filter->service, settings, NULL);
502506

503507
const char *type = NULL;
508+
#ifdef _WIN32
504509
void *handle = os_dlopen("obs");
510+
#else
511+
void *handle = dlopen(NULL, RTLD_LAZY);
512+
#endif
505513
if (handle) {
506514
const char *(*type_func)(obs_service_t *) =
507515
(const char *(*)(obs_service_t *))os_dlsym(handle, "obs_service_get_output_type");
@@ -2414,7 +2422,11 @@ bool obs_module_load(void)
24142422

24152423
void obs_module_post_load(void)
24162424
{
2425+
#ifdef _WIN32
24172426
void *handle = os_dlopen("obs");
2427+
#else
2428+
void *handle = dlopen(NULL, RTLD_LAZY);
2429+
#endif
24182430
if (handle) {
24192431
obs_encoder_set_frame_rate_divisor_func =
24202432
(bool (*)(obs_encoder_t *, uint32_t))os_dlsym(handle, "obs_encoder_set_frame_rate_divisor");

0 commit comments

Comments
 (0)