Skip to content

Commit

Permalink
Add compatibility check code for old versions of Chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
Huachao committed Dec 11, 2021
1 parent 1cbfd15 commit 36f68fa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions trunk/src/app/srs_app_rtc_conn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2903,6 +2903,11 @@ srs_error_t SrsRtcConnection::negotiate_publish_capability(SrsRtcUserConfig* ruc
}
} else if (remote_media_desc.is_video() && ruc->codec_ == "av1") {
std::vector<SrsMediaPayloadType> payloads = remote_media_desc.find_media_with_encoding_name("AV1");
if (payloads.empty()) {
// Be compatible with the Chrome M96, still check the AV1X encoding name
// @see https://bugs.chromium.org/p/webrtc/issues/detail?id=13166
payloads = remote_media_desc.find_media_with_encoding_name("AV1X");
}
if (payloads.empty()) {
return srs_error_new(ERROR_RTC_SDP_EXCHANGE, "no found valid AV1 payload type");
}
Expand Down Expand Up @@ -3214,6 +3219,11 @@ srs_error_t SrsRtcConnection::negotiate_play_capability(SrsRtcUserConfig* ruc, s
track_descs = source->get_track_desc("audio", "opus");
} else if (remote_media_desc.is_video() && ruc->codec_ == "av1") {
std::vector<SrsMediaPayloadType> payloads = remote_media_desc.find_media_with_encoding_name("AV1");
if (payloads.empty()) {
// Be compatible with the Chrome M96, still check the AV1X encoding name
// @see https://bugs.chromium.org/p/webrtc/issues/detail?id=13166
payloads = remote_media_desc.find_media_with_encoding_name("AV1X");
}
if (payloads.empty()) {
return srs_error_new(ERROR_RTC_SDP_EXCHANGE, "no found valid AV1 payload type");
}
Expand Down

0 comments on commit 36f68fa

Please sign in to comment.