From efcd77078edb25ed211225d954245f30507d1585 Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: Mon, 19 Oct 2020 20:45:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9RTP=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E6=96=B9=E6=B3=95=EF=BC=8C=E7=A1=AE=E4=BF=9D?= =?UTF-8?q?=E5=88=86=E9=85=8D=E5=81=B6=E6=95=B0=E7=AB=AF=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/genersoft/iot/vmp/media/zlm/ZLMUtils.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMUtils.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMUtils.java index f88d59c6..422f6220 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMUtils.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMUtils.java @@ -36,7 +36,7 @@ public class ZLMUtils { System.out.println(newPort); System.out.println(jsonObject.toJSONString()); return newPort; - }else { + } else { return getNewRTPPort(ssrc); } } @@ -48,11 +48,14 @@ public class ZLMUtils { udpPortRangeArray[1] = Integer.parseInt(udpPortRangeStrArray[1]); } - if (currentPort == 0 || currentPort ++ > udpPortRangeArray[1]) { + if (currentPort == 0 || currentPort++ > udpPortRangeArray[1]) { currentPort = udpPortRangeArray[0]; return udpPortRangeArray[0]; - }else { - return currentPort ++; + } else { + if (currentPort % 2 == 1) { + currentPort++; + } + return currentPort++; } } }