Android VideoCapturerAndroid: Move stopListening() call to stopCaptureOnCameraThread()

switchCamera() only calls stopCaptureOnCameraThread(), not
stopCapture(), so the stopListening() call must be placed there.

BUG=webrtc:5519,b/27497950
R=perkj@webrtc.org

Review URL: https://codereview.webrtc.org/1770423002 .

Cr-Commit-Position: refs/heads/master@{#11917}
This commit is contained in:
Magnus Jedvert
2016-03-08 20:38:07 +01:00
parent 5ed5ed953d
commit 1ae6a45986

View File

@ -544,8 +544,6 @@ public class VideoCapturerAndroid implements
final CountDownLatch barrier = new CountDownLatch(1);
cameraThreadHandler.post(new Runnable() {
@Override public void run() {
// Make sure onTextureFrameAvailable() is not called anymore.
surfaceHelper.stopListening();
stopCaptureOnCameraThread();
barrier.countDown();
}
@ -566,6 +564,8 @@ public class VideoCapturerAndroid implements
return;
}
// Make sure onTextureFrameAvailable() is not called anymore.
surfaceHelper.stopListening();
cameraThreadHandler.removeCallbacks(cameraObserver);
cameraStatistics.getAndResetFrameCount();
Logging.d(TAG, "Stop preview.");