Fixed the channel editor and added extra locking into the CURL protocol.

This commit is contained in:
Rolf Ahrenberg 2013-03-02 19:58:37 +02:00
parent 72a9f21006
commit d7dfa0aad6
3 changed files with 7 additions and 3 deletions

View File

@ -198,3 +198,4 @@ VDR Plugin 'iptv' Revision History
- Fixed bugs found in the CURL implementation (Thanks - Fixed bugs found in the CURL implementation (Thanks
to Jeremy Hall). to Jeremy Hall).
- Fixed the channel editor.

View File

@ -424,6 +424,7 @@ int cIptvProtocolCurl::Read(unsigned char* bufferAddrP, unsigned int bufferLenP)
switch (modeM) { switch (modeM) {
case eModeRtsp: case eModeRtsp:
{ {
cMutexLock MutexLock(&mutexM);
CURLcode res = CURLE_OK; CURLcode res = CURLE_OK;
iptv_curl_easy_setopt(handleM, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_RECEIVE); iptv_curl_easy_setopt(handleM, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_RECEIVE);
iptv_curl_easy_perform(handleM); iptv_curl_easy_perform(handleM);
@ -439,6 +440,7 @@ int cIptvProtocolCurl::Read(unsigned char* bufferAddrP, unsigned int bufferLenP)
int running_handles; int running_handles;
do { do {
cMutexLock MutexLock(&mutexM);
res = curl_multi_perform(multiM, &running_handles); res = curl_multi_perform(multiM, &running_handles);
} while (res == CURLM_CALL_MULTI_PERFORM); } while (res == CURLM_CALL_MULTI_PERFORM);
@ -455,7 +457,9 @@ int cIptvProtocolCurl::Read(unsigned char* bufferAddrP, unsigned int bufferLenP)
// Check if end of file // Check if end of file
if (running_handles == 0) { if (running_handles == 0) {
int msgcount; int msgcount;
mutexM.Lock();
CURLMsg *msg = curl_multi_info_read(multiM, &msgcount); CURLMsg *msg = curl_multi_info_read(multiM, &msgcount);
mutexM.Unlock();
if (msg && (msg->msg == CURLMSG_DONE)) { if (msg && (msg->msg == CURLMSG_DONE)) {
debug("cIptvProtocolCurl::%s(done): %s (%d)", __FUNCTION__, debug("cIptvProtocolCurl::%s(done): %s (%d)", __FUNCTION__,
curl_easy_strerror(msg->data.result), msg->data.result); curl_easy_strerror(msg->data.result), msg->data.result);

View File

@ -164,9 +164,8 @@ void cIptvSourceParam::SetData(cChannel *channelP)
void cIptvSourceParam::GetData(cChannel *channelP) void cIptvSourceParam::GetData(cChannel *channelP)
{ {
debug("cIptvSourceParam::%s(%s)", __FUNCTION__, channelP->Parameters()); debug("cIptvSourceParam::%s(%s)", __FUNCTION__, channelP->Parameters());
dataM.SetTransponderData(channelP->Source(), channelP->Frequency(), dataM.Srate(), itpM.ToString(Source()), true); channelP->SetTransponderData(channelP->Source(), channelP->Frequency(), dataM.Srate(), itpM.ToString(Source()), true);
dataM.SetId(nidM, tidM, channelP->Sid(), ridM); channelP->SetId(nidM, tidM, channelP->Sid(), ridM);
*channelP = dataM;
} }
cOsdItem *cIptvSourceParam::GetOsdItem(void) cOsdItem *cIptvSourceParam::GetOsdItem(void)