Add rollback for send encodings
Bug: chromium:1188398
Change-Id: I9491426cd4a3983c7065f18af3c843d498eeafe1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/214121
Commit-Queue: Eldar Rello <elrello@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33630}
diff --git a/pc/sdp_offer_answer.cc b/pc/sdp_offer_answer.cc
index 293c5cb..1381bf9 100644
--- a/pc/sdp_offer_answer.cc
+++ b/pc/sdp_offer_answer.cc
@@ -1423,8 +1423,15 @@
const std::vector<StreamParams>& streams = channel->local_streams();
transceiver->internal()->sender_internal()->set_stream_ids(
streams[0].stream_ids());
+ auto encodings =
+ transceiver->internal()->sender_internal()->init_send_encodings();
transceiver->internal()->sender_internal()->SetSsrc(
streams[0].first_ssrc());
+ if (!encodings.empty()) {
+ transceivers()
+ ->StableState(transceiver)
+ ->SetInitSendEncodings(encodings);
+ }
}
}
} else {
@@ -2722,6 +2729,10 @@
transceivers()->Remove(transceiver);
}
}
+ if (state.init_send_encodings()) {
+ transceiver->internal()->sender_internal()->set_init_send_encodings(
+ state.init_send_encodings().value());
+ }
transceiver->internal()->sender_internal()->set_transport(nullptr);
transceiver->internal()->receiver_internal()->set_transport(nullptr);
transceiver->internal()->set_mid(state.mid());