Commit 87acd73efcde49cb5630c266db4ebd3f6b1b9dfd
Merge remote-tracking branch 'origin/wvp-28181-2.0' into wvp-28181-2.0
Showing
1 changed file
with
8 additions
and
0 deletions
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java
| ... | ... | @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; |
| 4 | 4 | import com.alibaba.fastjson.JSONObject; |
| 5 | 5 | import com.alibaba.fastjson.TypeReference; |
| 6 | 6 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| 7 | +import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; | |
| 7 | 8 | import com.genersoft.iot.vmp.media.zlm.dto.MediaItem; |
| 8 | 9 | import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; |
| 9 | 10 | import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; |
| ... | ... | @@ -29,6 +30,9 @@ public class StreamPushServiceImpl implements IStreamPushService { |
| 29 | 30 | @Autowired |
| 30 | 31 | private StreamPushMapper streamPushMapper; |
| 31 | 32 | |
| 33 | + @Autowired | |
| 34 | + private ZLMRESTfulUtils zlmresTfulUtils; | |
| 35 | + | |
| 32 | 36 | @Override |
| 33 | 37 | public List<StreamPushItem> handleJSON(String jsonData) { |
| 34 | 38 | if (jsonData == null) return null; |
| ... | ... | @@ -84,6 +88,10 @@ public class StreamPushServiceImpl implements IStreamPushService { |
| 84 | 88 | @Override |
| 85 | 89 | public boolean removeFromGB(GbStream stream) { |
| 86 | 90 | int del = gbStreamMapper.del(stream.getApp(), stream.getStream()); |
| 91 | + JSONObject mediaList = zlmresTfulUtils.getMediaList(stream.getApp(), stream.getStream()); | |
| 92 | + if (mediaList == null) { | |
| 93 | + streamPushMapper.del(stream.getApp(), stream.getStream()); | |
| 94 | + } | |
| 87 | 95 | return del > 0; |
| 88 | 96 | } |
| 89 | 97 | } | ... | ... |