临时提交

This commit is contained in:
lin
2025-09-15 18:01:00 +08:00
parent 5c83bf2a41
commit 576feec514

View File

@@ -85,12 +85,12 @@ public class ZLMServerFactory {
param.put("ssrc", ssrc); param.put("ssrc", ssrc);
} }
JSONObject openRtpServerResultJson = zlmresTfulUtils.openRtpServer(mediaServerItem, param); ZLMResult<?> zlmResult = zlmresTfulUtils.openRtpServer(mediaServerItem, param);
if (openRtpServerResultJson != null) { if (zlmResult != null) {
if (openRtpServerResultJson.getInteger("code") == 0) { if (zlmResult.getCode() == 0) {
result= openRtpServerResultJson.getInteger("port"); result= zlmResult.getPort();
}else { }else {
log.error("创建RTP Server 失败 {}: ", openRtpServerResultJson.getString("msg")); log.error("创建RTP Server 失败 {}: ", zlmResult.getMsg());
} }
}else { }else {
// 检查ZLM状态 // 检查ZLM状态
@@ -104,13 +104,12 @@ public class ZLMServerFactory {
if (serverItem !=null){ if (serverItem !=null){
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
param.put("stream_id", streamId); param.put("stream_id", streamId);
JSONObject jsonObject = zlmresTfulUtils.closeRtpServer(serverItem, param); ZLMResult<?> zlmResult = zlmresTfulUtils.closeRtpServer(serverItem, param);
log.info("关闭RTP Server " + jsonObject); if (zlmResult != null ) {
if (jsonObject != null ) { if (zlmResult.getCode() == 0) {
if (jsonObject.getInteger("code") == 0) { result = zlmResult.getHit() >= 1;
result = jsonObject.getInteger("hit") >= 1;
}else { }else {
log.error("关闭RTP Server 失败: " + jsonObject.getString("msg")); log.error("关闭RTP Server 失败: " + zlmResult.getMsg());
} }
}else { }else {
// 检查ZLM状态 // 检查ZLM状态