Little refactor in SDPMunging

pull/600/head
cruizba 2020-09-08 12:40:29 +02:00
parent 16bdf6cd88
commit ea9776bccb
1 changed files with 3 additions and 6 deletions

View File

@ -184,17 +184,14 @@ public class SDPMunging {
} }
if (mVideoLineIndex == -1) { if (mVideoLineIndex == -1) {
throw new OpenViduException(Code.FORCED_CODEC_NOT_FOUND_IN_SDPOFFER, "This SDP does not offer video"); throw new OpenViduException(Code.FORCED_CODEC_NOT_FOUND_IN_SDPOFFER, "This SDP does not offer video");
} } else {
if (mVideoLineIndex != -1) {
for (String codecPayload: validCodecsPayload) { for (String codecPayload: validCodecsPayload) {
if (!sdp.contains(String.format("a=fmtp:%s", codecPayload))) { if (!sdp.contains(String.format("a=fmtp:%s", codecPayload))) {
String newfmtpLine = String.format("a=fmtp:%s level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f", codecPayload); String newfmtpLine = String.format("a=fmtp:%s level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f", codecPayload);
lines.add(mVideoLineIndex + 1, newfmtpLine); lines.add(mVideoLineIndex + 1, newfmtpLine);
} }
} }
}
}
// Return munging sdp!! // Return munging sdp!!
String[] munguedSdpLines = lines.toArray(new String[lines.size()]); String[] munguedSdpLines = lines.toArray(new String[lines.size()]);