Bug 817141 - Call EndTrack()/Finish() from StopPreview() (as well) to prevent deadlock. r=kchen

This commit is contained in:
Mike Habicher 2012-12-04 21:00:39 -05:00
parent ef9f3747d2
commit 2884d9a473

View File

@ -251,6 +251,8 @@ DOMCameraPreview::StopPreview()
DOM_CAMERA_LOGI("Stopping preview stream\n");
mState = STOPPING;
mCameraControl->StopPreview();
mInput->EndTrack(TRACK_VIDEO);
mInput->Finish();
}
void
@ -258,8 +260,11 @@ DOMCameraPreview::SetStateStopped()
{
NS_ASSERTION(NS_IsMainThread(), "SetStateStopped() not called from main thread");
// see bug 809259 and bug 817367.
if (mState != STOPPING) {
mInput->EndTrack(TRACK_VIDEO);
mInput->Finish();
}
mState = STOPPED;
DOM_CAMERA_LOGI("Preview stream stopped\n");