From d21a00418e04cc773eaeeff3d220e5931023929a Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Tue, 15 Mar 2022 16:58:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8E=A8=E6=B5=81=E5=85=B3?= =?UTF-8?q?=E8=81=94=E5=B9=B3=E5=8F=B0=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gb28181/transmit/cmd/impl/SIPCommander.java | 14 +++++++------- .../iot/vmp/media/zlm/ZLMRTPServerFactory.java | 2 +- .../storager/impl/VideoManagerStoragerImpl.java | 7 +++---- .../components/dialog/chooseChannelForStream.vue | 2 +- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java index 5df6314e..d2ef5edd 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java @@ -670,6 +670,7 @@ public class SIPCommander implements ISIPCommander { try { SsrcTransaction ssrcTransaction = streamSession.getSsrcTransaction(deviceId, channelId, null, stream); ClientTransaction transaction = streamSession.getTransactionByStream(deviceId, channelId, stream); + if (transaction == null) { logger.warn("[ {} -> {}]停止视频流的时候发现事务已丢失", deviceId, channelId); SipSubscribe.EventResult eventResult = new SipSubscribe.EventResult<>(); @@ -685,7 +686,12 @@ public class SIPCommander implements ISIPCommander { if (stream == null) return; dialog = streamSession.getDialogByStream(deviceId, channelId, stream); } - + if (ssrcTransaction != null) { + MediaServerItem mediaServerItem = mediaServerService.getOne(ssrcTransaction.getMediaServerId()); + mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcTransaction.getSsrc()); + mediaServerService.closeRTPServer(deviceId, channelId, ssrcTransaction.getStream()); + streamSession.remove(deviceId, channelId, ssrcTransaction.getStream()); + } if (dialog == null) { logger.warn("[ {} -> {}]停止视频流的时候发现对话已丢失", deviceId, channelId); @@ -730,12 +736,6 @@ public class SIPCommander implements ISIPCommander { dialog.sendRequest(clientTransaction); - if (ssrcTransaction != null) { - MediaServerItem mediaServerItem = mediaServerService.getOne(ssrcTransaction.getMediaServerId()); - mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcTransaction.getSsrc()); - mediaServerService.closeRTPServer(deviceId, channelId, ssrcTransaction.getStream()); - streamSession.remove(deviceId, channelId, ssrcTransaction.getStream()); - } } catch (SipException | ParseException e) { e.printStackTrace(); } diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java index 276ee233..9f22f826 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java @@ -95,7 +95,7 @@ public class ZLMRTPServerFactory { if (openRtpServerResultJson.getInteger("code") == 0) { result= openRtpServerResultJson.getInteger("port"); }else { - logger.error("创建RTP Server 失败 {}: " + openRtpServerResultJson.getString("msg"), param.get("port")); + logger.error("创建RTP Server 失败 {}: ", openRtpServerResultJson.getString("msg")); } }else { // 检查ZLM状态 diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java index 9992ebc4..0ba0ab4a 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java @@ -885,12 +885,11 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { List parentPlatforms = parentPlatformMapper.selectAllAhareAllLiveStream(); if (parentPlatforms.size() > 0) { for (ParentPlatform parentPlatform : parentPlatforms) { - streamPushItem.setCatalogId(parentPlatform.getCatalogId()); - streamPushItem.setPlatformId(parentPlatform.getServerGBId()); - String stream = streamPushItem.getStream(); - StreamProxyItem streamProxyItems = platformGbStreamMapper.selectOne(streamPushItem.getApp(), stream, + StreamProxyItem streamProxyItems = platformGbStreamMapper.selectOne(streamPushItem.getApp(), streamPushItem.getStream(), parentPlatform.getServerGBId()); if (streamProxyItems == null) { + streamPushItem.setCatalogId(parentPlatform.getCatalogId()); + streamPushItem.setPlatformId(parentPlatform.getServerGBId()); platformGbStreamMapper.add(streamPushItem); eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), streamPushItem, CatalogEvent.ADD); } diff --git a/web_src/src/components/dialog/chooseChannelForStream.vue b/web_src/src/components/dialog/chooseChannelForStream.vue index eeee14e8..d5e5ac38 100644 --- a/web_src/src/components/dialog/chooseChannelForStream.vue +++ b/web_src/src/components/dialog/chooseChannelForStream.vue @@ -174,7 +174,7 @@ export default { page: that.currentPage, count: that.count, query: that.searchSrt, - pushing: that.online, + pushing: that.pushing, platformId: that.platformId, catalogId: that.catalogId, mediaServerId: that.mediaServerId