Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1634)

Unified Diff: webrtc/api/android/jni/androidvideotracksource_jni.cc

Issue 2173853002: Fix a bug where SourceState on AndroidVideoTrackSource is set to live even on failure. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/android/jni/androidvideotracksource_jni.cc
diff --git a/webrtc/api/android/jni/androidvideotracksource_jni.cc b/webrtc/api/android/jni/androidvideotracksource_jni.cc
index 5ec281ab987dba547da52b24c68b39561e33b411..96054df26a767f30d0b65e1291d4865b1469c427 100644
--- a/webrtc/api/android/jni/androidvideotracksource_jni.cc
+++ b/webrtc/api/android/jni/androidvideotracksource_jni.cc
@@ -66,7 +66,11 @@ JOW_OBSERVER_METHOD(void, nativeCapturerStarted)
LOG(LS_INFO) << "AndroidVideoTrackSourceObserve_nativeCapturerStarted";
webrtc::AndroidVideoTrackSource* source =
AndroidVideoTrackSourceFromJavaProxy(j_source);
- source->SetState(webrtc::AndroidVideoTrackSource::SourceState::kLive);
+ if (j_success) {
+ source->SetState(webrtc::AndroidVideoTrackSource::SourceState::kLive);
magjed_webrtc 2016/07/22 14:47:08 nit: I prefer ternary, so only one call to SetStat
sakal 2016/07/22 14:53:47 Done.
+ } else {
+ source->SetState(webrtc::AndroidVideoTrackSource::SourceState::kEnded);
+ }
}
JOW_OBSERVER_METHOD(void, nativeCapturerStopped)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698