mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
Fix RTP over TCP with a nasty hack.
This commit is contained in:
parent
8130a4b4e5
commit
98ecd22a27
22
rtsp.c
22
rtsp.c
@ -206,6 +206,28 @@ bool cSatipRtsp::SetInterface(const char *bindAddrP)
|
||||
return result;
|
||||
}
|
||||
|
||||
bool cSatipRtsp::Receive(const char *uriP)
|
||||
{
|
||||
debug1("%s (%s) [device %d]", __PRETTY_FUNCTION__, uriP, tunerM.GetId());
|
||||
bool result = false;
|
||||
|
||||
if (handleM && !isempty(uriP) && modeM == cSatipConfig::eTransportModeRtpOverTcp) {
|
||||
long rc = 0;
|
||||
cTimeMs processing(0);
|
||||
CURLcode res = CURLE_OK;
|
||||
|
||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_URL, uriP);
|
||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_STREAM_URI, uriP);
|
||||
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_OPTIONS); // FIXME: this really should be CURL_RTSPREQ_RECEIVE, but getting timeout errors
|
||||
SATIP_CURL_EASY_PERFORM(handleM);
|
||||
|
||||
result = ValidateLatestResponse(&rc);
|
||||
debug5("%s (%s) Response %ld in %" PRIu64 " ms [device %d]", __PRETTY_FUNCTION__, uriP, rc, processing.Elapsed(), tunerM.GetId());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool cSatipRtsp::Options(const char *uriP)
|
||||
{
|
||||
debug1("%s (%s) [device %d]", __PRETTY_FUNCTION__, uriP, tunerM.GetId());
|
||||
|
1
rtsp.h
1
rtsp.h
@ -59,6 +59,7 @@ public:
|
||||
cString RtspUnescapeString(const char *strP);
|
||||
void Reset(void);
|
||||
bool SetInterface(const char *bindAddrP);
|
||||
bool Receive(const char *uriP);
|
||||
bool Options(const char *uriP);
|
||||
bool Setup(const char *uriP, int rtpPortP, int rtcpPortP, bool useTcpP);
|
||||
bool SetSession(const char *sessionP);
|
||||
|
14
tuner.c
14
tuner.c
@ -175,6 +175,7 @@ void cSatipTuner::Action(void)
|
||||
idleCheck.Set(eIdleCheckTimeoutMs);
|
||||
break;
|
||||
}
|
||||
Receive();
|
||||
break;
|
||||
default:
|
||||
error("Unknown tuner status %d [device %d]", currentStateM, deviceIdM);
|
||||
@ -544,6 +545,19 @@ bool cSatipTuner::UpdatePids(bool forceP)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cSatipTuner::Receive(void)
|
||||
{
|
||||
debug16("%s tunerState=%s [device %d]", __PRETTY_FUNCTION__, TunerStateString(currentStateM), deviceIdM);
|
||||
cMutexLock MutexLock(&mutexM);
|
||||
if (!isempty(*streamAddrM)) {
|
||||
cString uri = GetBaseUrl(*streamAddrM, streamPortM);
|
||||
if (!rtspM.Receive(*uri))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cSatipTuner::KeepAlive(bool forceP)
|
||||
{
|
||||
debug16("%s (%d) tunerState=%s [device %d]", __PRETTY_FUNCTION__, forceP, TunerStateString(currentStateM), deviceIdM);
|
||||
|
Loading…
Reference in New Issue
Block a user