From 3c025a5ac04b7b8fd619ea62d0cfeceb2060cce3 Mon Sep 17 00:00:00 2001 From: xingqiao <xingqiao@uni-ubi.com> Date: 星期五, 26 八月 2022 11:03:43 +0800 Subject: [PATCH] 1.解决轮询内存增长过快问题 --- src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java index 0dc6bd3..21879ab 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java @@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -98,9 +99,7 @@ @PostMapping(value = "/on_server_keepalive", produces = "application/json;charset=UTF-8") public ResponseEntity<String> onServerKeepalive(@RequestBody JSONObject json){ - if (logger.isDebugEnabled()) { - logger.debug("[ ZLM HOOK ] on_server_keepalive API璋冪敤锛屽弬鏁帮細" + json.toString()); - } + logger.info("[ ZLM HOOK ] on_server_keepalive API璋冪敤锛屽弬鏁帮細" + json.toString()); String mediaServerId = json.getString("mediaServerId"); List<ZLMHttpHookSubscribe.Event> subscribes = this.subscribe.getSubscribes(HookType.on_server_keepalive); if (subscribes != null && subscribes.size() > 0) { @@ -445,12 +444,15 @@ if (streamInfo!=null){ redisCatchStorage.stopPlay(streamInfo); storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId()); + // 濡傛灉姝e湪缁欎笂绾ф帹閫侊紝鍒欏彂閫乥ye + }else{ streamInfo = redisCatchStorage.queryPlayback(null, null, stream, null); if (streamInfo != null) { redisCatchStorage.stopPlayback(streamInfo.getDeviceID(), streamInfo.getChannelId(), streamInfo.getStream(), null); } + // 濡傛灉姝e湪缁欎笂绾ф帹閫侊紝鍒欏彂閫乥ye } }else { if (!"rtp".equals(app)){ @@ -632,7 +634,7 @@ private Map<String, String> urlParamToMap(String params) { HashMap<String, String> map = new HashMap<>(); - if (StringUtils.isEmpty(params)) { + if (ObjectUtils.isEmpty(params)) { return map; } String[] paramsArray = params.split("&"); -- Gitblit v1.8.0