Commit 74c9e0400d0df8d7ba35f564ac8e2e1d82a340ce

Authored by panlinlin
1 parent 4005962c

修复错误的使用stream作为ssrc导致的无法stop问题

src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java
... ... @@ -121,7 +121,9 @@ public class SipLayer implements SipListener {
121 121 logger.debug(evt.getRequest().toString());
122 122 // 由于jainsip是单线程程序,为提高性能并发处理
123 123 processThreadPool.execute(() -> {
124   - processorFactory.createRequestProcessor(evt).process();
  124 + if (processorFactory != null) {
  125 + processorFactory.createRequestProcessor(evt).process();
  126 + }
125 127 });
126 128 }
127 129  
... ...
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
... ... @@ -290,12 +290,8 @@ public class SIPCommander implements ISIPCommander {
290 290 @Override
291 291 public void playStreamCmd(Device device, String channelId, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent) {
292 292 try {
293   - String ssrc = "";
294   - if (rtpEnable) {
295   - ssrc = String.format("gb_play_%s_%s", device.getDeviceId(), channelId);
296   - }else {
297   - ssrc = streamSession.createPlaySsrc();
298   - }
  293 +
  294 + String ssrc = streamSession.createPlaySsrc();
299 295 String streamId = null;
300 296 if (rtpEnable) {
301 297 streamId = String.format("gb_play_%s_%s", device.getDeviceId(), channelId);
... ... @@ -412,16 +408,8 @@ public class SIPCommander implements ISIPCommander {
412 408 , SipSubscribe.Event errorEvent) {
413 409 try {
414 410 MediaServerConfig mediaInfo = redisCatchStorage.getMediaInfo();
415   - String ssrc = null;
416   - String streamId = null;
417   - if (rtpEnable) {
418   - ssrc = String.format("gb_playback_%s_%s", device.getDeviceId(), channelId);
419   - streamId = ssrc;
420   - }else {
421   - ssrc = streamSession.createPlayBackSsrc();
422   - streamId = String.format("%08x", Integer.parseInt(ssrc)).toUpperCase();
423   - }
424   -
  411 + String ssrc = streamSession.createPlayBackSsrc();
  412 + String streamId = String.format("%08x", Integer.parseInt(ssrc)).toUpperCase();
425 413 // 添加订阅
426 414 JSONObject subscribeKey = new JSONObject();
427 415 subscribeKey.put("app", "rtp");
... ...