8000 chore: Skip set_sdp_fmtp_line if sdpFmtpLine is empty. · liliBestCoder/flutter-webrtc@8d4efb5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8d4efb5

Browse files
committed
chore: Skip set_sdp_fmtp_line if sdpFmtpLine is empty.
1 parent da1169e commit 8d4efb5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

android/src/main/java/com/cloudwebrtc/webrtc/PeerConnectionObserver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ public void rtpTransceiverSetCodecPreferences(String transceiverId, List<Map<Str
10531053
codecCapability.clockRate = (int) codec.get("clockRate");
10541054
if(codec.get("numChannels") != null)
10551055
codecCapability.numChannels = (int) codec.get("numChannels");
1056-
if(codec.get("sdpFmtpLine") != null) {
1056+
if(codec.get("sdpFmtpLine") != null && codec.get("sdpFmtpLine") != "") {
10571057
String sdpFmtpLine = (String) codec.get("sdpFmtpLine");
10581058
codecCapability.parameters = new HashMap<>();
10591059
String[] parameters = sdpFmtpLine.split(";");

common/cpp/src/flutter_peerconnection.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ void FlutterPeerConnection::RtpTransceiverSetCodecPreferences(
801801
auto codecNumChannels = findInt(codecMap, "channels");
802802
auto codecSdpFmtpLine = findString(codecMap, "sdpFmtpLine");
803803
auto codecCapability = RTCRtpCodecCapability::Create();
804-
if (codecSdpFmtpLine != std::string())
804+
if (codecSdpFmtpLine != std::string() && codecSdpFmtpLine.length() != 0)
805805
codecCapability->set_sdp_fmtp_line(codecSdpFmtpLine);
806806
codecCapability->set_clock_rate(codecClockRate);
807807
if (codecNumChannels != -1)

common/darwin/Classes/FlutterRTCPeerConnection.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ - (void)transceiverSetCodecPreferences:(nonnull NSDictionary*)argsMap
817817
codec.clockRate = c[@"clockRate"];
818818
codec.kind = mediaTypeFromString([kindAndName[0] lowercaseString]);
819819
codec.name = kindAndName[1];
820-
if (c[@"sdpFmtpLine"] != nil) {
820+
if (c[@"sdpFmtpLine"] != nil && ![((NSString*)c[@"sdpFmtpLine"]) isEqualToString:@""]) {
821821
codec.parameters = stringToParameters((NSString*)c[@"sdpFmtpLine"]);
822822
}
823823
if (c[@"channels"] != nil) {

0 commit comments

Comments
 (0)
0