From ca79100b6fae7b1963d1653227d67345893a0672 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Mon, 7 Mar 2022 01:23:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E5=BD=95=E5=83=8F=E7=82=B9=E6=92=AD=E7=9A=84ssrc=E9=87=8A?= =?UTF-8?q?=E6=94=BE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/service/impl/PlayServiceImpl.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java index 286f8237..2df78b76 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java @@ -348,6 +348,7 @@ public class PlayServiceImpl implements IPlayService { msg.setId(uuid); msg.setKey(key); PlayBackResult playBackResult = new PlayBackResult<>(); + Timer timer = new Timer(); timer.schedule(new TimerTask() { @Override @@ -356,7 +357,16 @@ public class PlayServiceImpl implements IPlayService { playBackResult.setCode(-1); playBackResult.setData(msg); callback.call(playBackResult); + SIPDialog dialog = streamSession.getDialogByStream(deviceId, channelId, ssrcInfo.getStream()); // 点播超时回复BYE 同时释放ssrc以及此次点播的资源 + if (dialog != null) { + // 点播超时回复BYE 同时释放ssrc以及此次点播的资源 + cmder.streamByeCmd(device.getDeviceId(), channelId, ssrcInfo.getStream()); + }else { + mediaServerService.releaseSsrc(newMediaServerItem.getId(), ssrcInfo.getSsrc()); + mediaServerService.closeRTPServer(deviceId, channelId, ssrcInfo.getStream()); + streamSession.remove(deviceId, channelId, ssrcInfo.getStream()); + } cmder.streamByeCmd(device.getDeviceId(), channelId, ssrcInfo.getStream()); // 回复之前所有的点播请求 callback.call(playBackResult);