From 3a1fc63d7ac0e3f686f28cad85f50cc594292e94 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期五, 15 十二月 2023 17:28:55 +0800
Subject: [PATCH] 优化ssrc释放逻辑

---
 src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
index 1b4b94e..e4c2684 100755
--- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
+++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
@@ -264,13 +264,17 @@
 
         // 鍥芥爣娴�
         if ("rtp".equals(param.getApp()) ) {
-            String ssrc = String.format("%010d", Long.parseLong(param.getStream(), 16));
-            InviteInfo inviteInfo = inviteStreamService.getInviteInfoBySSRC(ssrc);
+
+            InviteInfo inviteInfo = inviteStreamService.getInviteInfoByStream(null, param.getStream());
 
             // 鍗曠鍙fā寮忎笅淇敼娴� ID
-            if (!mediaInfo.isRtpEnable() && inviteInfo != null) {
-                result.setStream_replace(inviteInfo.getStream());
-                logger.info("[ZLM HOOK]鎺ㄦ祦閴存潈 stream: {} 鏇挎崲涓� {}", param.getStream(), inviteInfo.getStream());
+            if (!mediaInfo.isRtpEnable() && inviteInfo == null) {
+                String ssrc = String.format("%010d", Long.parseLong(param.getStream(), 16));
+                inviteInfo = inviteStreamService.getInviteInfoBySSRC(ssrc);
+                if (inviteInfo != null) {
+                    result.setStream_replace(inviteInfo.getStream());
+                    logger.info("[ZLM HOOK]鎺ㄦ祦閴存潈 stream: {} 鏇挎崲涓� {}", param.getStream(), inviteInfo.getStream());
+                }
             }
 
             // 璁剧疆闊抽淇℃伅鍙婂綍鍒朵俊鎭�

--
Gitblit v1.8.0