From f88c70d38ce1c9c0d04460d0c225373c84dc2eca Mon Sep 17 00:00:00 2001 From: dengming <dengming@ctfo.com> Date: 星期四, 10 三月 2022 17:27:07 +0800 Subject: [PATCH] 删除重复字段,channelId字段查询了两次 --- src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) 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 30a1509..a0b7e75 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 @@ -205,7 +205,7 @@ /** * 璋冪敤zlm RESTful API 鈥斺�� startSendRtp */ - public Boolean startSendRtpStream(MediaServerItem mediaServerItem, Map<String, Object>param) { + public JSONObject startSendRtpStream(MediaServerItem mediaServerItem, Map<String, Object>param) { Boolean result = false; JSONObject jsonObject = zlmresTfulUtils.startSendRtp(mediaServerItem, param); if (jsonObject == null) { @@ -216,7 +216,7 @@ } else { logger.error("RTP鎺ㄦ祦澶辫触: " + jsonObject.getString("msg")); } - return result; + return jsonObject; } /** @@ -242,9 +242,18 @@ */ public int totalReaderCount(MediaServerItem mediaServerItem, String app, String streamId) { JSONObject mediaInfo = zlmresTfulUtils.getMediaInfo(mediaServerItem, app, "rtmp", streamId); + Integer code = mediaInfo.getInteger("code"); if (mediaInfo == null) { return 0; } + if ( code < 0) { + logger.warn("鏌ヨ娴�({}/{})鏄惁鏈夊叾瀹冭鐪嬭�呮椂寰楀埌锛� {}", app, streamId, mediaInfo.getString("msg")); + return -1; + } + if ( code == 0 && ! mediaInfo.getBoolean("online")) { + logger.warn("鏌ヨ娴�({}/{})鏄惁鏈夊叾瀹冭鐪嬭�呮椂寰楀埌锛� {}", app, streamId, mediaInfo.getString("msg")); + return -1; + } return mediaInfo.getInteger("totalReaderCount"); } -- Gitblit v1.8.0