From cb1f1417b622b20e94133d89c6cb7fa9cbe6f4ed Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Fri, 15 Dec 2023 22:44:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E5=9B=9E=E5=A4=8D=E7=9A=84in?= =?UTF-8?q?vite=20200OK=E6=B6=88=E6=81=AF=E4=B8=AD=E7=BC=BA=E5=B0=91ssrc(y?= =?UTF-8?q?=E5=AD=97=E6=AE=B5)=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/service/impl/PlayServiceImpl.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java index 4e2a174a..05169b7f 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java @@ -314,7 +314,13 @@ public class PlayServiceImpl implements IPlayService { if (!device.getStreamMode().equalsIgnoreCase("TCP-ACTIVE")) { return; } - String substring = contentString.substring(0, contentString.indexOf("y=")); + + String substring; + if (contentString.indexOf("y=") > 0) { + substring = contentString.substring(0, contentString.indexOf("y=")); + }else { + substring = contentString; + } try { SessionDescription sdp = SdpFactory.getInstance().createSessionDescription(substring); int port = -1; @@ -568,6 +574,10 @@ public class PlayServiceImpl implements IPlayService { ResponseEvent responseEvent = (ResponseEvent) eventResult.event; String contentString = new String(responseEvent.getResponse().getRawContent()); String ssrcInResponse = SipUtils.getSsrcFromSdp(contentString); + // 兼容回复的消息中缺少ssrc(y字段)的情况 + if (ssrcInResponse == null) { + ssrcInResponse = ssrcInfo.getSsrc(); + } if (ssrcInfo.getSsrc().equals(ssrcInResponse)) { // ssrc 一致 if (mediaServerItem.isRtpEnable()) {