优化发流逻辑

This commit is contained in:
648540858
2023-07-31 16:42:12 +08:00
parent 17ea37506e
commit 3de49d1c2a
3 changed files with 7 additions and 29 deletions

View File

@@ -163,15 +163,9 @@ public class ZLMRTPServerFactory {
public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId,
String deviceId, String channelId, boolean tcp, boolean rtcp){
// 默认为随机端口
int localPort = 0;
if (userSetting.getGbSendStreamStrict()) {
if (userSetting.getGbSendStreamStrict()) {
localPort = sendRtpPortManager.getNextPort(serverItem);
if (localPort == 0) {
return null;
}
}
int localPort = sendRtpPortManager.getNextPort(serverItem);
if (localPort == 0) {
return null;
}
SendRtpItem sendRtpItem = new SendRtpItem();
sendRtpItem.setIp(ip);
@@ -201,13 +195,10 @@ public class ZLMRTPServerFactory {
*/
public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId,
String app, String stream, String channelId, boolean tcp, boolean rtcp){
// 默认为随机端口
int localPort = 0;
if (userSetting.getGbSendStreamStrict()) {
localPort = sendRtpPortManager.getNextPort(serverItem);
if (localPort == 0) {
return null;
}
int localPort = sendRtpPortManager.getNextPort(serverItem);
if (localPort == 0) {
return null;
}
SendRtpItem sendRtpItem = new SendRtpItem();
sendRtpItem.setIp(ip);