From 00bb8d914a5a48bae84f20bf1891b7462605a0dc Mon Sep 17 00:00:00 2001
From: leesam <leesam@leesam.cn>
Date: 星期五, 15 三月 2024 09:42:25 +0800
Subject: [PATCH] [bugfix]修复云端录像查询时间转换错误的问题

---
 src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMServerFactory.java |   28 ++++++++++++----------------
 1 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMServerFactory.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMServerFactory.java
old mode 100644
new mode 100755
index c81e00d..2422206
--- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMServerFactory.java
+++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMServerFactory.java
@@ -42,7 +42,7 @@
      * @param tcpMode 0/null udp 妯″紡锛�1 tcp 琚姩妯″紡, 2 tcp 涓诲姩妯″紡銆�
      * @return
      */
-    public int createRTPServer(MediaServerItem mediaServerItem, String streamId, int ssrc, Integer port, Boolean onlyAuto, Boolean reUsePort, Integer tcpMode) {
+    public int createRTPServer(MediaServerItem mediaServerItem, String streamId, long ssrc, Integer port, Boolean onlyAuto, Boolean reUsePort, Integer tcpMode) {
         int result = -1;
         // 鏌ヨ姝tp server 鏄惁宸茬粡瀛樺湪
         JSONObject rtpInfo = zlmresTfulUtils.getRtpInfo(mediaServerItem, streamId);
@@ -86,10 +86,13 @@
         }else {
             param.put("port", port);
         }
-        param.put("ssrc", ssrc);
         if (onlyAuto != null) {
             param.put("only_audio", onlyAuto?"1":"0");
         }
+        if (ssrc != 0) {
+            param.put("ssrc", ssrc);
+        }
+
         JSONObject openRtpServerResultJson = zlmresTfulUtils.openRtpServer(mediaServerItem, param);
         logger.info(JSONObject.toJSONString(openRtpServerResultJson));
         if (openRtpServerResultJson != null) {
@@ -165,13 +168,9 @@
     public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId,
                                          String deviceId, String channelId, boolean tcp, boolean rtcp){
 
-        // 榛樿涓洪殢鏈虹鍙�
-        int localPort = 0;
-        if (userSetting.getGbSendStreamStrict()) {
-            localPort = sendRtpPortManager.getNextPort(serverItem.getId());
-            if (localPort == 0) {
-                return null;
-            }
+        int localPort = sendRtpPortManager.getNextPort(serverItem);
+        if (localPort == 0) {
+            return null;
         }
         SendRtpItem sendRtpItem = new SendRtpItem();
         sendRtpItem.setIp(ip);
@@ -201,13 +200,10 @@
      */
     public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId,
                                          String app, String stream, String channelId, boolean tcp, boolean rtcp){
-        // 榛樿涓洪殢鏈虹鍙�
-        int localPort = 0;
-        if (userSetting.getGbSendStreamStrict()) {
-            localPort = sendRtpPortManager.getNextPort(serverItem.getId());
-            if (localPort == 0) {
-                return null;
-            }
+
+        int localPort = sendRtpPortManager.getNextPort(serverItem);
+        if (localPort == 0) {
+            return null;
         }
         SendRtpItem sendRtpItem = new SendRtpItem();
         sendRtpItem.setIp(ip);

--
Gitblit v1.8.0