1
0
mirror of https://github.com/rofafor/vdr-plugin-satip.git synced 2023-10-10 11:37:42 +00:00

Make it possible to specify the rtp and rtcp ports

this makes it possible to use the satip through a
NAT (e.g. a docker bridged network)
This commit is contained in:
chriszero
2016-01-07 20:56:39 +01:00
committed by Rolf Ahrenberg
parent c1a881ba94
commit 9d5f7cc703
7 changed files with 59 additions and 7 deletions

View File

@@ -50,12 +50,15 @@ cSatipTuner::cSatipTuner(cSatipDeviceIf &deviceP, unsigned int packetLenP)
debug1("%s (, %d) [device %d]", __PRETTY_FUNCTION__, packetLenP, deviceIdM);
// Open sockets
int i = 100;
int i = SatipConfig.GetPortRangeStart() ? SatipConfig.GetPortRangeStop() - SatipConfig.GetPortRangeStart() - 1 : 100;
int port = SatipConfig.GetPortRangeStart();
while (i-- > 0) {
if (rtpM.Open(0) && rtcpM.Open(rtpM.Port() + 1))
if (rtpM.Open(port) && rtcpM.Open(rtpM.Port() + 1))
break;
rtpM.Close();
rtcpM.Close();
if (SatipConfig.GetPortRangeStart())
++port;
}
if ((rtpM.Port() <= 0) || (rtcpM.Port() <= 0)) {
error("Cannot open required RTP/RTCP ports [device %d]", deviceIdM);