Commit a30b21cd authored by bemasc@chromium.org's avatar bemasc@chromium.org

Revert 242936 "When stopping QTKit video capture, call stopRunni..."

This CL removed a deadlock on camera removal, but created a new one
on shutdown while a camera is running.

> When stopping QTKit video capture, call stopRunning before removeInput:.
> 
> Empirically, this prevents a browser hang when the active camera is
> unplugged.  The unplug event triggers both stopping the capturer and
> enumerating the available input devices at the same time.  It seems
> that calling removeInput: on a running capturer after an error
> produces a deadlock, but stopping the capturer first resolves the
> problem.
> 
> BUG=285053
> 
> Review URL: https://codereview.chromium.org/120963003

TBR=bemasc@chromium.org

Review URL: https://codereview.chromium.org/126883005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243445 0039d316-1c4b-4281-b951-d872f2087c98
parent 5865860f
...@@ -219,10 +219,8 @@ ...@@ -219,10 +219,8 @@
- (void)stopCapture { - (void)stopCapture {
if ([[captureSession_ inputs] count] == 1) { if ([[captureSession_ inputs] count] == 1) {
// |stopRunning| must be called before |removeInput:| to avoid a deadlock
// with device enumeration when the active camera is unplugged.
[captureSession_ stopRunning];
[captureSession_ removeInput:captureDeviceInput_]; [captureSession_ removeInput:captureDeviceInput_];
[captureSession_ stopRunning];
} }
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment