Skip to content

Commit

Permalink
Update AVMonitor.m
Browse files Browse the repository at this point in the history
  • Loading branch information
objective-see committed Nov 8, 2023
1 parent 0c2436a commit c5ae162
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Application/Application/AVMonitor.m
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ -(BOOL)watchAudioDevice:(AVCaptureDevice*)device

//delay
// need time for logging to grab responsible process
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

//client
Client* client = nil;
Expand Down Expand Up @@ -879,7 +879,7 @@ -(BOOL)watchVideoDevice:(AVCaptureDevice*)device

//delay
// need time for logging to grab responsible process
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

//client
Client* client = nil;
Expand Down Expand Up @@ -1310,13 +1310,13 @@ -(NSUInteger)shouldShowNotification:(Event*)event

//ignore if last event was same state
if( (deviceLastEvent.state == event.state) &&
([event.timestamp timeIntervalSinceDate:deviceLastEvent.timestamp] < 2.0f) )
([event.timestamp timeIntervalSinceDate:deviceLastEvent.timestamp] < 1.0f) )
{
//set result
result = NOTIFICATION_SPURIOUS;

//dbg msg
os_log_debug(logHandle, "ignoring event as it was same state as last (%ld), and happened <2.0s ago", (long)event.state);
os_log_debug(logHandle, "ignoring event as it was same state as last (%ld), and happened <1.0s ago", (long)event.state);

//bail
goto bail;
Expand Down

0 comments on commit c5ae162

Please sign in to comment.