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

Unified Diff: webrtc/media/engine/webrtcvoiceengine.cc

Issue 2478433003: Revert of Removed the legacy behavior of stopping playout when setting new receive codecs. (Closed)
Patch Set: Created 4 years, 1 month 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 | « webrtc/media/engine/webrtcvoiceengine.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvoiceengine.cc
diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc
index 9636ff32fc4fc98a21402e6d11c4d1433da6ed10..71803cbee38c845e1cf4afbfa90c15ca94f062e3 100644
--- a/webrtc/media/engine/webrtcvoiceengine.cc
+++ b/webrtc/media/engine/webrtcvoiceengine.cc
@@ -1705,6 +1705,12 @@
return true;
}
+ if (playout_) {
+ // Receive codecs can not be changed while playing. So we temporarily
+ // pause playout.
+ ChangePlayout(false);
+ }
+
bool result = true;
for (const AudioCodec& codec : new_codecs) {
webrtc::CodecInst voe_codec = {0};
@@ -1729,6 +1735,9 @@
recv_codecs_ = codecs;
}
+ if (desired_playout_ && !playout_) {
+ ChangePlayout(desired_playout_);
+ }
return result;
}
@@ -1983,7 +1992,12 @@
}
void WebRtcVoiceMediaChannel::SetPlayout(bool playout) {
- TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::SetPlayout");
+ desired_playout_ = playout;
+ return ChangePlayout(desired_playout_);
+}
+
+void WebRtcVoiceMediaChannel::ChangePlayout(bool playout) {
+ TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::ChangePlayout");
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
if (playout_ == playout) {
return;
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698