Commit ab13017117b18427bb5ee687c9a1b3fd5a94f2ae

Authored by panlinlin
1 parent 6e67b190

处理空指针

src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/ByeRequestProcessor.java
... ... @@ -48,6 +48,7 @@ public class ByeRequestProcessor extends SIPRequestAbstractProcessor {
48 48 String platformGbId = ((SipURI) ((HeaderAddress) evt.getRequest().getHeader(FromHeader.NAME)).getAddress().getURI()).getUser();
49 49 String channelId = ((SipURI) ((HeaderAddress) evt.getRequest().getHeader(ToHeader.NAME)).getAddress().getURI()).getUser();
50 50 SendRtpItem sendRtpItem = redisCatchStorage.querySendRTPServer(platformGbId, channelId);
  51 + if (sendRtpItem == null) return;
51 52 String streamId = sendRtpItem.getStreamId();
52 53 Map<String, Object> param = new HashMap<>();
53 54 param.put("vhost","__defaultVhost__");
... ...
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
... ... @@ -295,25 +295,26 @@ public class ZLMHttpHookListener {
295 295  
296 296 String streamId = json.getString("stream");
297 297 String app = json.getString("app");
298   - StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId);
299   -
300 298  
301 299 if ("rtp".equals(app)){
302 300 JSONObject ret = new JSONObject();
303 301 ret.put("code", 0);
304 302 ret.put("close", true);
305   - if (streamInfo != null) {
306   - if (redisCatchStorage.isChannelSendingRTP(streamInfo.getChannelId())) {
  303 + StreamInfo streamInfoForPlayCatch = redisCatchStorage.queryPlayByStreamId(streamId);
  304 + if (streamInfoForPlayCatch != null) {
  305 + if (redisCatchStorage.isChannelSendingRTP(streamInfoForPlayCatch.getChannelId())) {
307 306 ret.put("close", false);
308 307 } else {
309   - cmder.streamByeCmd(streamInfo.getDeviceID(), streamInfo.getChannelId());
310   - redisCatchStorage.stopPlay(streamInfo);
311   - storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId());
  308 + cmder.streamByeCmd(streamInfoForPlayCatch.getDeviceID(), streamInfoForPlayCatch.getChannelId());
  309 + redisCatchStorage.stopPlay(streamInfoForPlayCatch);
  310 + storager.stopPlay(streamInfoForPlayCatch.getDeviceID(), streamInfoForPlayCatch.getChannelId());
312 311 }
313 312 }else{
314   - cmder.streamByeCmd(streamInfo.getDeviceID(), streamInfo.getChannelId());
315   - streamInfo = redisCatchStorage.queryPlaybackByStreamId(streamId);
316   - redisCatchStorage.stopPlayback(streamInfo);
  313 + StreamInfo streamInfoForPlayBackCatch = redisCatchStorage.queryPlaybackByStreamId(streamId);
  314 + if (streamInfoForPlayBackCatch != null) {
  315 + cmder.streamByeCmd(streamInfoForPlayBackCatch.getDeviceID(), streamInfoForPlayBackCatch.getChannelId());
  316 + redisCatchStorage.stopPlayback(streamInfoForPlayBackCatch);
  317 + }
317 318 }
318 319 return new ResponseEntity<String>(ret.toString(),HttpStatus.OK);
319 320 }else {
... ...
web_src/src/components/dialog/StreamProxyEdit.vue
... ... @@ -62,14 +62,14 @@
62 62 <el-checkbox label="转HLS" v-model="proxyParam.enable_hls" ></el-checkbox>
63 63 <el-checkbox label="MP4录制" v-model="proxyParam.enable_mp4" ></el-checkbox>
64 64 </div>
65   -
  65 +
66 66 </el-form-item>
67 67 <el-form-item>
68 68 <div style="float: right;">
69 69 <el-button type="primary" @click="onSubmit">{{onSubmit_text}}</el-button>
70 70 <el-button @click="close">取消</el-button>
71 71 </div>
72   -
  72 +
73 73 </el-form-item>
74 74 </el-form>
75 75 </div>
... ... @@ -110,7 +110,7 @@ export default {
110 110 type: "default",
111 111 app: null,
112 112 stream: null,
113   - url: "rtmp://58.200.131.2:1935/livetv/hunantv",
  113 + url: "rtmp://58.200.131.2/livetv/cctv5hd",
114 114 src_url: null,
115 115 timeout_ms: null,
116 116 ffmpeg_cmd_key: null,
... ... @@ -120,7 +120,7 @@ export default {
120 120 enable_hls: true,
121 121 enable_mp4: false,
122 122 },
123   -
  123 +
124 124 rules: {
125 125 name: [{ required: true, message: "请输入名称", trigger: "blur" }],
126 126 app: [{ required: true, message: "请输入应用名", trigger: "blur" }],
... ... @@ -148,7 +148,7 @@ export default {
148 148 var that = this;
149 149 that.$axios({
150 150 method: 'post',
151   - url:`/api/proxy/save`,
  151 + url:`/api/proxy/save`,
152 152 data: that.proxyParam
153 153 }).then(function (res) {
154 154 console.log(res);
... ...