From ea9776bccb4a3adc9e9cb36a13731eb3b874572d Mon Sep 17 00:00:00 2001 From: cruizba Date: Tue, 8 Sep 2020 12:40:29 +0200 Subject: [PATCH] Little refactor in SDPMunging --- .../main/java/io/openvidu/server/utils/SDPMunging.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/openvidu-server/src/main/java/io/openvidu/server/utils/SDPMunging.java b/openvidu-server/src/main/java/io/openvidu/server/utils/SDPMunging.java index 0a705481..254604ac 100644 --- a/openvidu-server/src/main/java/io/openvidu/server/utils/SDPMunging.java +++ b/openvidu-server/src/main/java/io/openvidu/server/utils/SDPMunging.java @@ -184,17 +184,14 @@ public class SDPMunging { } if (mVideoLineIndex == -1) { throw new OpenViduException(Code.FORCED_CODEC_NOT_FOUND_IN_SDPOFFER, "This SDP does not offer video"); - } - - if (mVideoLineIndex != -1) { + } else { for (String codecPayload: validCodecsPayload) { 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); lines.add(mVideoLineIndex + 1, newfmtpLine); } - } - - } + } + } // Return munging sdp!! String[] munguedSdpLines = lines.toArray(new String[lines.size()]);