File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ namespace jni
3737
3838 void start ();
3939 void stop ();
40+ void terminate ();
4041
4142 // AdaptedVideoTrackSource implementation.
4243 virtual bool is_screencast () const override ;
Original file line number Diff line number Diff line change @@ -88,6 +88,13 @@ namespace jni
8888 }
8989 }
9090
91+ void VideoTrackDesktopSource::terminate ()
92+ {
93+ // Notify the track that we are permanently done.
94+ sourceState = kEnded ;
95+ FireOnChanged ();
96+ }
97+
9198 bool VideoTrackDesktopSource::is_screencast () const {
9299 return true ;
93100 }
@@ -110,10 +117,7 @@ namespace jni
110117 if (result == webrtc::DesktopCapturer::Result::ERROR_PERMANENT) {
111118 RTC_LOG (LS_ERROR) << " Permanent error capturing desktop frame. Stopping track." ;
112119
113- // Notify the track that we are permanently done.
114- sourceState = kEnded ;
115- FireOnChanged ();
116-
120+ terminate ();
117121 stop ();
118122 }
119123
@@ -254,6 +258,7 @@ namespace jni
254258 }
255259
256260 if (!capturer->SelectSource (sourceId)) {
261+ terminate ();
257262 return ;
258263 }
259264
You can’t perform that action at this time.
0 commit comments