From 692f7167883a246067dfa0dc7f7f16d6ef309d9b Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期五, 16 九月 2022 18:02:56 +0800
Subject: [PATCH] 优化点播时RtpServer为正常关闭的问题

---
 src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 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 a5b5f19..f1f4072 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
@@ -98,7 +98,18 @@
                 result = rtpInfo.getInteger("local_port");
                 if (result == 0) {
                     // 姝ゆ椂璇存槑rtpServer宸茬粡鍒涘缓浣嗘槸娴佽繕娌℃湁鎺ㄤ笂鏉�
-
+                    // 姝ゆ椂閲嶆柊鎵撳紑rtpServer
+                    Map<String, Object> param = new HashMap<>();
+                    param.put("stream_id", streamId);
+                    JSONObject jsonObject = zlmresTfulUtils.closeRtpServer(mediaServerItem, param);
+                    if (jsonObject != null ) {
+                        System.out.println(jsonObject);
+                        if (jsonObject.getInteger("code") == 0) {
+                            return createRTPServer(mediaServerItem, streamId, ssrc, port);
+                        }else {
+                            logger.warn("[寮�鍚痳tpServer], 閲嶅惎RtpServer閿欒");
+                        }
+                    }
                 }
                 return result;
             }

--
Gitblit v1.8.0