panlinlin
2021-04-20 ab13017117b18427bb5ee687c9a1b3fd5a94f2ae
处理空指针
3个文件已修改
24 ■■■■ 已修改文件
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/ByeRequestProcessor.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_src/src/components/dialog/StreamProxyEdit.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/ByeRequestProcessor.java
@@ -48,6 +48,7 @@
                String platformGbId = ((SipURI) ((HeaderAddress) evt.getRequest().getHeader(FromHeader.NAME)).getAddress().getURI()).getUser();
                String channelId = ((SipURI) ((HeaderAddress) evt.getRequest().getHeader(ToHeader.NAME)).getAddress().getURI()).getUser();
                SendRtpItem sendRtpItem =  redisCatchStorage.querySendRTPServer(platformGbId, channelId);
                if (sendRtpItem == null) return;
                String streamId = sendRtpItem.getStreamId();
                Map<String, Object> param = new HashMap<>();
                param.put("vhost","__defaultVhost__");
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
@@ -295,25 +295,26 @@
        
        String streamId = json.getString("stream");
        String app = json.getString("app");
        StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId);
        if ("rtp".equals(app)){
            JSONObject ret = new JSONObject();
            ret.put("code", 0);
            ret.put("close", true);
            if (streamInfo != null) {
                if (redisCatchStorage.isChannelSendingRTP(streamInfo.getChannelId())) {
            StreamInfo streamInfoForPlayCatch = redisCatchStorage.queryPlayByStreamId(streamId);
            if (streamInfoForPlayCatch != null) {
                if (redisCatchStorage.isChannelSendingRTP(streamInfoForPlayCatch.getChannelId())) {
                    ret.put("close", false);
                } else {
                    cmder.streamByeCmd(streamInfo.getDeviceID(), streamInfo.getChannelId());
                    redisCatchStorage.stopPlay(streamInfo);
                    storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId());
                    cmder.streamByeCmd(streamInfoForPlayCatch.getDeviceID(), streamInfoForPlayCatch.getChannelId());
                    redisCatchStorage.stopPlay(streamInfoForPlayCatch);
                    storager.stopPlay(streamInfoForPlayCatch.getDeviceID(), streamInfoForPlayCatch.getChannelId());
                }
            }else{
                cmder.streamByeCmd(streamInfo.getDeviceID(), streamInfo.getChannelId());
                streamInfo = redisCatchStorage.queryPlaybackByStreamId(streamId);
                redisCatchStorage.stopPlayback(streamInfo);
                StreamInfo streamInfoForPlayBackCatch = redisCatchStorage.queryPlaybackByStreamId(streamId);
                if (streamInfoForPlayBackCatch != null) {
                    cmder.streamByeCmd(streamInfoForPlayBackCatch.getDeviceID(), streamInfoForPlayBackCatch.getChannelId());
                    redisCatchStorage.stopPlayback(streamInfoForPlayBackCatch);
                }
            }
            return new ResponseEntity<String>(ret.toString(),HttpStatus.OK);
        }else {
web_src/src/components/dialog/StreamProxyEdit.vue
@@ -110,7 +110,7 @@
          type: "default",
          app: null,
          stream: null,
          url: "rtmp://58.200.131.2:1935/livetv/hunantv",
          url: "rtmp://58.200.131.2/livetv/cctv5hd",
          src_url: null,
          timeout_ms: null,
          ffmpeg_cmd_key: null,