优化点播时RtpServer为正常关闭的问题
This commit is contained in:
@@ -98,7 +98,18 @@ public class ZLMRTPServerFactory {
|
||||
result = rtpInfo.getInteger("local_port");
|
||||
if (result == 0) {
|
||||
// 此时说明rtpServer已经创建但是流还没有推上来
|
||||
|
||||
// 此时重新打开rtpServer
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("stream_id", streamId);
|
||||
JSONObject jsonObject = zlmresTfulUtils.closeRtpServer(mediaServerItem, param);
|
||||
if (jsonObject != null ) {
|
||||
System.out.println(jsonObject);
|
||||
if (jsonObject.getInteger("code") == 0) {
|
||||
return createRTPServer(mediaServerItem, streamId, ssrc, port);
|
||||
}else {
|
||||
logger.warn("[开启rtpServer], 重启RtpServer错误");
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ public class ZLMRunner implements CommandLineRunner {
|
||||
}, 60 * 1000 );
|
||||
}
|
||||
|
||||
@Async
|
||||
@Async("taskExecutor")
|
||||
public void connectZlmServer(MediaServerItem mediaServerItem){
|
||||
String connectZlmServerTaskKey = "connect-zlm-" + mediaServerItem.getId();
|
||||
ZLMServerConfig zlmServerConfigFirst = getMediaServerConfig(mediaServerItem);
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ZLMStatusEventListener {
|
||||
@Autowired
|
||||
private IPlayService playService;
|
||||
|
||||
@Async
|
||||
@Async("taskExecutor")
|
||||
@EventListener
|
||||
public void onApplicationEvent(ZLMOnlineEvent event) {
|
||||
logger.info("[ZLM] 上线 ID:" + event.getMediaServerId());
|
||||
@@ -45,7 +45,7 @@ public class ZLMStatusEventListener {
|
||||
playService.zlmServerOnline(event.getMediaServerId());
|
||||
}
|
||||
|
||||
@Async
|
||||
@Async("taskExecutor")
|
||||
@EventListener
|
||||
public void onApplicationEvent(ZLMOfflineEvent event) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user