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

Unified Diff: webrtc/api/audiotrack.cc

Issue 1790633002: Propagate MediaStreamSource state to video tracks the same way as audio. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@refactor_track
Patch Set: Fix bug with wrong enum values. Created 4 years, 9 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 | « talk/app/webrtc/objc/public/RTCTypes.h ('k') | webrtc/api/java/src/org/webrtc/MediaStreamTrack.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/audiotrack.cc
diff --git a/webrtc/api/audiotrack.cc b/webrtc/api/audiotrack.cc
index 5e92686ee9d228a76aceb47fc461b40899f0db03..c2c9557c9e3ed56a7b1b66465e56ef93288ba245 100644
--- a/webrtc/api/audiotrack.cc
+++ b/webrtc/api/audiotrack.cc
@@ -65,27 +65,11 @@ void AudioTrack::RemoveSink(AudioTrackSinkInterface* sink) {
void AudioTrack::OnChanged() {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- if (state() == kFailed)
- return; // We can't recover from this state (do we ever set it?).
-
- TrackState new_state = kInitializing;
-
- // |audio_source_| must be non-null if we ever get here.
- switch (audio_source_->state()) {
- case MediaSourceInterface::kLive:
- case MediaSourceInterface::kMuted:
- new_state = kLive;
- break;
- case MediaSourceInterface::kEnded:
- new_state = kEnded;
- break;
- case MediaSourceInterface::kInitializing:
- default:
- // use kInitializing.
- break;
+ if (audio_source_->state() == MediaSourceInterface::kEnded) {
+ set_state(kEnded);
+ } else {
+ set_state(kLive);
}
-
- set_state(new_state);
}
} // namespace webrtc
« no previous file with comments | « talk/app/webrtc/objc/public/RTCTypes.h ('k') | webrtc/api/java/src/org/webrtc/MediaStreamTrack.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698