Skip to content

Commit

Permalink
Fix ScreenRecorder#stop return value
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrous26 committed Dec 9, 2012
1 parent 69e253f commit ae117d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions History.markdown
@@ -1,3 +1,7 @@
# 0.1.1 - Derp Release

* Fixed `ScreenRecorder#stop` return value

# 0.1.0 - Initial Release

* CRuby and MacRuby compatible
Expand Down
8 changes: 5 additions & 3 deletions ext/screen_recorder/MCScreenRecorder.m
Expand Up @@ -104,7 +104,7 @@ - (BOOL) stop
[self.session stopRunning];
[self.output stopRecording];

if (!dispatch_semaphore_wait(self.sema, SEMA_WAIT_TIME))
if (dispatch_semaphore_wait(self.sema, SEMA_WAIT_TIME))
return NO;

// need to wait for some callbacks because we want synchronousness
Expand All @@ -113,9 +113,11 @@ - (BOOL) stop
case kCFRunLoopRunStopped:
break;
case kCFRunLoopRunTimedOut:
return NO; // 'did not get callback'
NSLog(@"Did not get callback");
return NO;
default:
return NO; // 'unexpected result from waiting for callback'
NSLog(@"Unexpected result from waiting for callback");
return NO;
}

if (dispatch_semaphore_wait(self.sema, SEMA_WAIT_TIME))
Expand Down

0 comments on commit ae117d0

Please sign in to comment.