From 74ad4235f1738ea8ca954bd396a35ddf90a6e37b Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期六, 01 七月 2023 13:01:56 +0800
Subject: [PATCH] 修复tcp主动的推流

---
 src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java
index a2093a8..e39474f 100644
--- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java
+++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java
@@ -174,9 +174,10 @@
             Map<String, Object> param = new HashMap<>();
             param.put("stream_id", streamId);
             JSONObject jsonObject = zlmresTfulUtils.closeRtpServer(serverItem, param);
+            logger.info("鍏抽棴RTP Server " +  jsonObject);
             if (jsonObject != null ) {
                 if (jsonObject.getInteger("code") == 0) {
-                    result = jsonObject.getInteger("hit") == 1;
+                    result = jsonObject.getInteger("hit") >= 1;
                 }else {
                     logger.error("鍏抽棴RTP Server 澶辫触: " + jsonObject.getString("msg"));
                 }
@@ -311,7 +312,7 @@
                     (MediaServerItem mediaServerItem, HookParam hookParam)->{
                         logger.info("[涓婄骇鐐规挱] {}->鐩戝惉绔彛鍒版湡缁х画淇濇寔鐩戝惉: {}", ssrc, finalLocalPort);
                         OnRtpServerTimeoutHookParam rtpServerTimeoutHookParam = (OnRtpServerTimeoutHookParam) hookParam;
-                        if (ssrc.equals(rtpServerTimeoutHookParam.getSsrc())) {
+                        if (ssrc.equals(rtpServerTimeoutHookParam.getStream_id())) {
                             if (keepPortCallback.keep(ssrc)) {
                                 logger.info("[涓婄骇鐐规挱] {}->鐩戝惉绔彛鍒版湡缁х画淇濇寔鐩戝惉", ssrc);
                                 keepPort(serverItem, ssrc, finalLocalPort, keepPortCallback);
@@ -352,6 +353,11 @@
      * 璋冪敤zlm RESTFUL API 鈥斺�� startSendRtpPassive
      */
     public JSONObject startSendRtpPassive(MediaServerItem mediaServerItem, Map<String, Object>param) {
+        System.out.println("=====================");
+        for (String s : param.keySet()) {
+            System.out.println(s + ": " + param.get(s));
+        }
+        System.out.println("=========END============");
         return zlmresTfulUtils.startSendRtpPassive(mediaServerItem, param);
     }
 

--
Gitblit v1.8.0