修改RTP端口计算方法,确保分配偶数端口
parent
fcf64ffa5e
commit
efcd77078e
|
@ -36,7 +36,7 @@ public class ZLMUtils {
|
||||||
System.out.println(newPort);
|
System.out.println(newPort);
|
||||||
System.out.println(jsonObject.toJSONString());
|
System.out.println(jsonObject.toJSONString());
|
||||||
return newPort;
|
return newPort;
|
||||||
}else {
|
} else {
|
||||||
return getNewRTPPort(ssrc);
|
return getNewRTPPort(ssrc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,11 +48,14 @@ public class ZLMUtils {
|
||||||
udpPortRangeArray[1] = Integer.parseInt(udpPortRangeStrArray[1]);
|
udpPortRangeArray[1] = Integer.parseInt(udpPortRangeStrArray[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentPort == 0 || currentPort ++ > udpPortRangeArray[1]) {
|
if (currentPort == 0 || currentPort++ > udpPortRangeArray[1]) {
|
||||||
currentPort = udpPortRangeArray[0];
|
currentPort = udpPortRangeArray[0];
|
||||||
return udpPortRangeArray[0];
|
return udpPortRangeArray[0];
|
||||||
}else {
|
} else {
|
||||||
return currentPort ++;
|
if (currentPort % 2 == 1) {
|
||||||
|
currentPort++;
|
||||||
|
}
|
||||||
|
return currentPort++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue