3737#ifdef __APPLE__
3838#include < sys/types.h>
3939#include < sys/stat.h>
40- #include < CoreAudio/CoreAudio.h>
4140#include " nodeobs_settings-osx.h"
4241#endif
4342
@@ -3868,20 +3867,8 @@ void OBS_settings::saveGenericSettings(std::vector<SubCategory> genericSettings,
38683867
38693868void getDevices (const char *source_id, const char *property_name, std::vector<ipc::value> &rval)
38703869{
3871- auto settings = obs_get_source_defaults (source_id);
3872- if (!settings)
3873- return ;
3874-
3875- const char *dummy_device_name = " does_not_exist" ;
3876- obs_data_set_string (settings, property_name, dummy_device_name);
3877- if (strcmp (source_id, " dshow_input" ) == 0 ) {
3878- obs_data_set_string (settings, " video_device_id" , dummy_device_name);
3879- obs_data_set_string (settings, " audio_device_id" , dummy_device_name);
3880- }
3881-
38823870 auto props = obs_get_source_properties (source_id);
38833871 if (!props) {
3884- obs_data_release (settings);
38853872 blog (LOG_WARNING, " Could not get source properties for source id: %s" , source_id);
38863873 return ;
38873874 }
@@ -3890,7 +3877,6 @@ void getDevices(const char *source_id, const char *property_name, std::vector<ip
38903877 if (!prop) {
38913878 blog (LOG_WARNING, " Could not get the property [%s] for source id: %s" , property_name, source_id);
38923879 obs_properties_destroy (props);
3893- obs_data_release (settings);
38943880 return ;
38953881 }
38963882
@@ -3914,7 +3900,6 @@ void getDevices(const char *source_id, const char *property_name, std::vector<ip
39143900 }
39153901
39163902 obs_properties_destroy (props);
3917- obs_data_release (settings);
39183903}
39193904
39203905#ifdef WIN32
@@ -4091,11 +4076,11 @@ void OBS_settings::OBS_settings_getVideoDevices(void *data, const int64_t id, co
40914076 rval.push_back (ipc::value ((uint32_t )0 ));
40924077 enumVideoDevices (rval);
40934078#elif __APPLE__
4094- // Here we do not invoke getDevices() because the mac-capture
4095- // plugin will not enumerate video devices unless it is fully initialized.
4096- // So instead, we will enumerate video devices manually. Hopefully,
4097- // mac-capture doesn't do anything special to enumerate video devices.
4098- // If so, then this implementation will need to be updated.
4079+ // Here we do not invoke getDevices() because the mac-capture
4080+ // plugin will not enumerate video devices unless it is fully initialized.
4081+ // So instead, we will enumerate video devices manually. Hopefully,
4082+ // mac-capture doesn't do anything special to enumerate video devices.
4083+ // If so, then this implementation will need to be updated.
40994084 auto devices = getVideoDevicesMacOS ();
41004085 rval.push_back (ipc::value ((uint64_t )devices.size ()));
41014086 for (const auto &[name, uid] : devices) {
0 commit comments