forked from mirror/monocles_chat
make sure we don’t dispose video source twice
(cherry picked from commit 0cec499565f4b0b2260d5d3f9c4fa32c5ee9893b)
This commit is contained in:
parent
fb0984dca0
commit
02eb039b51
2 changed files with 10 additions and 1 deletions
|
@ -87,7 +87,15 @@ class VideoSourceWrapper {
|
|||
public void dispose() {
|
||||
this.cameraVideoCapturer.dispose();
|
||||
if (this.videoSource != null) {
|
||||
this.videoSource.dispose();
|
||||
dispose(this.videoSource);
|
||||
}
|
||||
}
|
||||
|
||||
private static void dispose(final VideoSource videoSource) {
|
||||
try {
|
||||
videoSource.dispose();
|
||||
} catch (final IllegalStateException e) {
|
||||
Log.e(Config.LOGTAG, "unable to dispose video source", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -468,6 +468,7 @@ public class WebRTCWrapper {
|
|||
this.localVideoTrack = null;
|
||||
this.remoteVideoTrack = null;
|
||||
if (videoSourceWrapper != null) {
|
||||
this.videoSourceWrapper = null;
|
||||
try {
|
||||
videoSourceWrapper.stopCapture();
|
||||
} catch (final InterruptedException e) {
|
||||
|
|
Loading…
Add table
Reference in a new issue