From 1af77ab5f7c11a4b3d59c1989b51b9fca29679ce Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期二, 18 十月 2022 22:18:49 +0800
Subject: [PATCH] Merge pull request #645 from IKangXu/wvp-28181-2.0

---
 src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java
index 8fabbda..f54147e 100644
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java
@@ -98,7 +98,7 @@
     @Override
     public StreamInfo save(StreamProxyItem param) {
         MediaServerItem mediaInfo;
-        if (param.getMediaServerId() == null || "auto".equals(param.getMediaServerId())){
+        if (ObjectUtils.isEmpty(param.getMediaServerId()) || "auto".equals(param.getMediaServerId())){
             mediaInfo = mediaServerService.getMediaServerForMinimumLoad();
         }else {
             mediaInfo = mediaServerService.getOne(param.getMediaServerId());
@@ -296,12 +296,11 @@
     public boolean start(String app, String stream) {
         boolean result = false;
         StreamProxyItem streamProxy = videoManagerStorager.queryStreamProxy(app, stream);
-        if (!streamProxy.isEnable() ) {
+        if (streamProxy != null && !streamProxy.isEnable() ) {
             JSONObject jsonObject = addStreamProxyToZlm(streamProxy);
             if (jsonObject == null) {
                 return false;
             }
-            System.out.println(jsonObject);
             if (jsonObject.getInteger("code") == 0) {
                 result = true;
                 streamProxy.setEnable(true);
@@ -427,7 +426,7 @@
                         if(data != null && data.size() > 0) {
                             for (int i = 0; i < data.size(); i++) {
                                 JSONObject streamJSONObj = data.getJSONObject(i);
-                                if ("rtmp".equals(streamJSONObj.getString("schema"))) {
+                                if ("rtsp".equals(streamJSONObj.getString("schema"))) {
                                     StreamInfo streamInfo = new StreamInfo();
                                     String app = streamJSONObj.getString("app");
                                     String stream = streamJSONObj.getString("stream");

--
Gitblit v1.8.0