make sure we don’t dispose video source twice
This commit is contained in:
parent
a7fe3e8372
commit
0cec499565
|
@ -87,7 +87,15 @@ class VideoSourceWrapper {
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
this.cameraVideoCapturer.dispose();
|
this.cameraVideoCapturer.dispose();
|
||||||
if (this.videoSource != null) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -460,6 +460,7 @@ public class WebRTCWrapper {
|
||||||
this.localVideoTrack = null;
|
this.localVideoTrack = null;
|
||||||
this.remoteVideoTrack = null;
|
this.remoteVideoTrack = null;
|
||||||
if (videoSourceWrapper != null) {
|
if (videoSourceWrapper != null) {
|
||||||
|
this.videoSourceWrapper = null;
|
||||||
try {
|
try {
|
||||||
videoSourceWrapper.stopCapture();
|
videoSourceWrapper.stopCapture();
|
||||||
} catch (final InterruptedException e) {
|
} catch (final InterruptedException e) {
|
||||||
|
|
Loading…
Reference in a new issue