mac-capture: Use int in place of NSNumber for owner_pid

master
David Bieber 2020-04-07 13:26:46 -04:00
parent ebbe856d83
commit 4718e5ecf5
2 changed files with 7 additions and 6 deletions

View File

@ -6,7 +6,7 @@
struct cocoa_window {
CGWindowID window_id;
NSNumber *owner_pid;
int owner_pid;
pthread_mutex_t name_lock;
NSString *owner_name;

View File

@ -60,10 +60,11 @@ bool find_window(cocoa_window_t cw, obs_data_t *settings, bool force)
NSNumber *window_id = (NSNumber *)dict[WINDOW_NUMBER];
cw->window_id = window_id.intValue;
cw->owner_pid = (NSNumber *)dict[OWNER_PID];
NSNumber *owner_pid = (NSNumber *)dict[OWNER_PID];
cw->owner_pid = owner_pid.intValue;
obs_data_set_int(settings, "window", cw->window_id);
obs_data_set_int(settings, "owner_pid", cw->owner_pid.intValue);
obs_data_set_int(settings, "owner_pid", cw->owner_pid);
return true;
}
@ -103,11 +104,11 @@ void init_window(cocoa_window_t cw, obs_data_t *settings)
NSNumber *window_id = (NSNumber *)dict[WINDOW_NUMBER];
cw->window_id = window_id.intValue;
cw->owner_pid = (NSNumber *)dict[OWNER_PID];
NSNumber *owner_pid = (NSNumber *)dict[OWNER_PID];
cw->owner_pid = owner_pid.intValue;
obs_data_set_int(settings, "window", cw->window_id);
obs_data_set_int(settings, "owner_pid",
cw->owner_pid.intValue);
obs_data_set_int(settings, "owner_pid", cw->owner_pid);
return;
}
}