648540858
2021-11-26 54568adfdd460164eba5c703f15b2d68b7971cd4
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
@@ -358,14 +358,13 @@
      String mediaServerId = json.getString("mediaServerId");
      String streamId = json.getString("stream");
      String app = json.getString("app");
      // TODO 如果在给上级推流,也不停止。
      if ("rtp".equals(app)){
         JSONObject ret = new JSONObject();
         ret.put("code", 0);
      if ("rtp".equals(app)){
         ret.put("close", true);
         StreamInfo streamInfoForPlayCatch = redisCatchStorage.queryPlayByStreamId(streamId);
         if (streamInfoForPlayCatch != null) {
            // 如果在给上级推流,也不停止。
            if (redisCatchStorage.isChannelSendingRTP(streamInfoForPlayCatch.getChannelId())) {
               ret.put("close", false);
            } else {
@@ -378,6 +377,12 @@
            if (streamInfoForPlayBackCatch != null) {
               cmder.streamByeCmd(streamInfoForPlayBackCatch.getDeviceID(), streamInfoForPlayBackCatch.getChannelId());
               redisCatchStorage.stopPlayback(streamInfoForPlayBackCatch);
            }else {
               StreamInfo streamInfoForDownload = redisCatchStorage.queryDownloadByStreamId(streamId);
               // 进行录像下载时无人观看不断流
               if (streamInfoForDownload != null) {
                  ret.put("close", false);
               }
            }
         }
         MediaServerItem mediaServerItem = mediaServerService.getOne(mediaServerId);
@@ -386,8 +391,6 @@
         }
         return new ResponseEntity<String>(ret.toString(),HttpStatus.OK);
      }else {
         JSONObject ret = new JSONObject();
         ret.put("code", 0);
         StreamProxyItem streamProxyItem = streamProxyService.getStreamProxyByAppAndStream(app, streamId);
         if (streamProxyItem != null && streamProxyItem.isEnable_remove_none_reader()) {
            ret.put("close", true);