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

Fixed the OPTIONS URL and enchanced the user agent string.

This commit is contained in:
Rolf Ahrenberg 2014-04-06 13:37:45 +03:00
parent 388543a58d
commit f2081c4f00
4 changed files with 14 additions and 4 deletions

View File

@ -381,6 +381,12 @@ unsigned int cSatipDevice::CheckData(void)
return 0; return 0;
} }
int cSatipDevice::GetId(void)
{
//debug("cSatipDevice::%s(%u)", __FUNCTION__, deviceIndexM);
return deviceIndexM;
}
uchar *cSatipDevice::GetData(int *availableP) uchar *cSatipDevice::GetData(int *availableP)
{ {
//debug("cSatipDevice::%s(%u)", __FUNCTION__, deviceIndexM); //debug("cSatipDevice::%s(%u)", __FUNCTION__, deviceIndexM);

View File

@ -107,6 +107,7 @@ public:
public: public:
virtual void WriteData(u_char *bufferP, int lengthP); virtual void WriteData(u_char *bufferP, int lengthP);
virtual unsigned int CheckData(void); virtual unsigned int CheckData(void);
virtual int GetId(void);
}; };
#endif // __SATIP_DEVICE_H #endif // __SATIP_DEVICE_H

View File

@ -14,6 +14,7 @@ public:
virtual ~cSatipDeviceIf() {} virtual ~cSatipDeviceIf() {}
virtual void WriteData(u_char *bufferP, int lengthP) = 0; virtual void WriteData(u_char *bufferP, int lengthP) = 0;
virtual unsigned int CheckData(void) = 0; virtual unsigned int CheckData(void) = 0;
virtual int GetId(void) = 0;
private: private:
cSatipDeviceIf(const cSatipDeviceIf&); cSatipDeviceIf(const cSatipDeviceIf&);

10
tuner.c
View File

@ -205,7 +205,7 @@ bool cSatipTuner::Connect(void)
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_CONNECTTIMEOUT_MS, (long)eConnectTimeoutMs); SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_CONNECTTIMEOUT_MS, (long)eConnectTimeoutMs);
// Set user-agent // Set user-agent
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_USERAGENT, *cString::sprintf("vdr-%s/%s", PLUGIN_NAME_I18N, VERSION)); SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_USERAGENT, *cString::sprintf("vdr-%s/%s (device %d)", PLUGIN_NAME_I18N, VERSION, deviceM->GetId()));
// Set URL // Set URL
char *p = curl_easy_unescape(handleM, *streamAddrM, 0, NULL); char *p = curl_easy_unescape(handleM, *streamAddrM, 0, NULL);
@ -227,16 +227,18 @@ bool cSatipTuner::Connect(void)
return false; return false;
} }
// Request server options: "&pids=all" for the whole mux // Request server options
keepAliveM.Set(timeoutM); keepAliveM.Set(timeoutM);
uri = cString::sprintf("rtsp://%s/?%s&pids=0", *streamAddrM, *streamParamM); uri = cString::sprintf("rtsp://%s/", *streamAddrM);
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_STREAM_URI, *uri); SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_STREAM_URI, *uri);
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_OPTIONS); SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_OPTIONS);
SATIP_CURL_EASY_PERFORM(handleM); SATIP_CURL_EASY_PERFORM(handleM);
if (!ValidateLatestResponse()) if (!ValidateLatestResponse())
return false; return false;
// Setup media stream // Setup media stream: "&pids=all" for the whole mux
uri = cString::sprintf("rtsp://%s/?%s&pids=0", *streamAddrM, *streamParamM);
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_STREAM_URI, *uri);
transport = cString::sprintf("RTP/AVP;unicast;client_port=%d-%d", rtpSocketM->Port(), rtcpSocketM->Port()); transport = cString::sprintf("RTP/AVP;unicast;client_port=%d-%d", rtpSocketM->Port(), rtcpSocketM->Port());
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_TRANSPORT, *transport); SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_TRANSPORT, *transport);
SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_SETUP); SATIP_CURL_EASY_SETOPT(handleM, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_SETUP);