From 2b1e56973edb72f990ee0d4a1b3e6d06ba3aa4d7 Mon Sep 17 00:00:00 2001 From: panlinlin <648540858@qq.com> Date: Sat, 3 Apr 2021 21:19:08 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=8E=A8=E6=B5=81=E7=9A=84?= =?UTF-8?q?=E5=9B=BD=E6=A0=87=E5=85=B3=E8=81=94=E7=A7=BB=E9=99=A4=E6=9C=AA?= =?UTF-8?q?=E6=8E=A8=E6=B5=81=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/service/impl/StreamPushServiceImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java index ce7f02b1..c0332c7e 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; import com.genersoft.iot.vmp.gb28181.bean.GbStream; +import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; import com.genersoft.iot.vmp.media.zlm.dto.MediaItem; import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; @@ -29,6 +30,9 @@ public class StreamPushServiceImpl implements IStreamPushService { @Autowired private StreamPushMapper streamPushMapper; + @Autowired + private ZLMRESTfulUtils zlmresTfulUtils; + @Override public List handleJSON(String jsonData) { if (jsonData == null) return null; @@ -84,6 +88,10 @@ public class StreamPushServiceImpl implements IStreamPushService { @Override public boolean removeFromGB(GbStream stream) { int del = gbStreamMapper.del(stream.getApp(), stream.getStream()); + JSONObject mediaList = zlmresTfulUtils.getMediaList(stream.getApp(), stream.getStream()); + if (mediaList == null) { + streamPushMapper.del(stream.getApp(), stream.getStream()); + } return del > 0; } }