File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ namespace jni
37
37
38
38
void start ();
39
39
void stop ();
40
+ void terminate ();
40
41
41
42
// AdaptedVideoTrackSource implementation.
42
43
virtual bool is_screencast () const override ;
Original file line number Diff line number Diff line change @@ -88,6 +88,13 @@ namespace jni
88
88
}
89
89
}
90
90
91
+ void VideoTrackDesktopSource::terminate ()
92
+ {
93
+ // Notify the track that we are permanently done.
94
+ sourceState = kEnded ;
95
+ FireOnChanged ();
96
+ }
97
+
91
98
bool VideoTrackDesktopSource::is_screencast () const {
92
99
return true ;
93
100
}
@@ -110,10 +117,7 @@ namespace jni
110
117
if (result == webrtc::DesktopCapturer::Result::ERROR_PERMANENT) {
111
118
RTC_LOG (LS_ERROR) << " Permanent error capturing desktop frame. Stopping track." ;
112
119
113
- // Notify the track that we are permanently done.
114
- sourceState = kEnded ;
115
- FireOnChanged ();
116
-
120
+ terminate ();
117
121
stop ();
118
122
}
119
123
@@ -254,6 +258,7 @@ namespace jni
254
258
}
255
259
256
260
if (!capturer->SelectSource (sourceId)) {
261
+ terminate ();
257
262
return ;
258
263
}
259
264
You can’t perform that action at this time.
0 commit comments