lawrencehj
2021-03-14 a71063dd1fc25d99486b36ba65c3081a3c8c7c01
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
@@ -267,20 +267,25 @@
      }
      
      String streamId = json.getString("stream");
      cmder.streamByeCmd(streamId);
      StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId);
      if (streamInfo!=null){
         redisCatchStorage.stopPlay(streamInfo);
         storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId());
      }else{
         streamInfo = redisCatchStorage.queryPlaybackByStreamId(streamId);
         redisCatchStorage.stopPlayback(streamInfo);
      }
      JSONObject ret = new JSONObject();
      ret.put("code", 0);
      ret.put("close", true);
      if (streamInfo != null) {
         if (redisCatchStorage.isChannelSendingRTP(streamInfo.getChannelId())) {
            ret.put("close", false);
         } else {
            cmder.streamByeCmd(streamId);
            redisCatchStorage.stopPlay(streamInfo);
            storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId());
         }
      }else{
         cmder.streamByeCmd(streamId);
         streamInfo = redisCatchStorage.queryPlaybackByStreamId(streamId);
         redisCatchStorage.stopPlayback(streamInfo);
      }
      return new ResponseEntity<String>(ret.toString(),HttpStatus.OK);
   }