Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #265 from krustyreturns/pvr.wmc_squash

update pvr.wmc to 0.2.93
  • Loading branch information...
commit 868e61141811cc7e28bc80a7a39f40e23dfa7b56 2 parents 31558d6 + cf20e87
@opdenkamp authored
View
2  addons/pvr.wmc/addon/addon.xml.in
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.wmc-@OS@-@ARCHITECTURE@"
- version="0.2.92"
+ version="0.2.93"
name="Windows Media Center Client - @OS@ @ARCHITECTURE@ Edition"
provider-name="KrustyReturns">
<requires>
View
BIN  addons/pvr.wmc/addon/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
83 addons/pvr.wmc/src/Socket.cpp
@@ -586,72 +586,95 @@ void Socket::SetTimeOut(int tSec)
_timeout = tSec;
}
-std::vector<CStdString> Socket::GetVector(const CStdString &request)
+std::vector<CStdString> Socket::GetVector(const CStdString &request, bool allowRetry)
{
+ int maxAttempts = 3;
+ int sleepAttempts = 1000;
+
PLATFORM::CLockObject lock(m_mutex); // only process one request at a time
int code;
std::vector<CStdString> reponses;
- if (!create()) // create the socket
- {
- XBMC->Log(LOG_ERROR, "Socket::GetVector> error could not create socket");
- reponses.push_back("SocketError"); // set a SocketError message (not fatal)
- }
- else // socket created OK
+ int cntAttempts = 1;
+ while (cntAttempts <= maxAttempts)
{
- if (!connect(_serverName, (unsigned short)_port)) // if this fails, it is likely due to server down
+ XBMC->Log(LOG_DEBUG, "Socket::GetVector> Send request \"%s\"", request.c_str());
+ reponses.clear();
+
+ if (!create()) // create the socket
{
- XBMC->Log(LOG_ERROR, "Socket::GetVector> Server is down");
- reponses.push_back("ServerDown"); // set a server down error message (not fatal)
+ XBMC->Log(LOG_ERROR, "Socket::GetVector> error could not create socket");
+ reponses.push_back("SocketError"); // set a SocketError message (not fatal)
}
- else // connected to server
+ else // socket created OK
{
- int bytesSent = SendRequest(request.c_str()); // send request to server
-
- if (bytesSent > 0) // if request was sent successfully
+ if (!connect(_serverName, (unsigned short)_port)) // if this fails, it is likely due to server down
+ {
+ XBMC->Log(LOG_ERROR, "Socket::GetVector> Server is down");
+ reponses.push_back("ServerDown"); // set a server down error message (not fatal)
+ }
+ else // connected to server
{
- if (!ReadResponses(code, reponses))
+ int bytesSent = SendRequest(request.c_str()); // send request to server
+
+ if (bytesSent > 0) // if request was sent successfully
{
- XBMC->Log(LOG_ERROR, "Socket::GetVector> error getting responses");
- reponses.clear();
+ if (!ReadResponses(code, reponses))
+ {
+ XBMC->Log(LOG_ERROR, "Socket::GetVector> error getting responses");
+ reponses.clear();
+ reponses.push_back("SocketError");
+ }
+ else
+ {
+ break;
+ }
+ }
+ else // error sending request
+ {
+ XBMC->Log(LOG_ERROR, "Socket::GetVector> error sending server request");
reponses.push_back("SocketError");
}
}
- else // error sending request
- {
- XBMC->Log(LOG_ERROR, "Socket::GetVector> error sending server request");
- reponses.push_back("SocketError");
- }
}
+
+ if (!allowRetry)
+ {
+ break;
+ }
+
+ cntAttempts++;
+ XBMC->Log(LOG_DEBUG, "Socket::GetVector> Retrying in %ims", sleepAttempts);
+ usleep(sleepAttempts);
}
close(); // close socket
return reponses; // return responses
}
-CStdString Socket::GetString(const CStdString &request)
+CStdString Socket::GetString(const CStdString &request, bool allowRetry)
{
- std::vector<CStdString> result = GetVector(request);
+ std::vector<CStdString> result = GetVector(request, allowRetry);
return result[0];
}
-bool Socket::GetBool(const CStdString &request)
+bool Socket::GetBool(const CStdString &request, bool allowRetry)
{
- return GetString(request) == "True";
+ return GetString(request, allowRetry) == "True";
}
-int Socket::GetInt(const CStdString &request)
+int Socket::GetInt(const CStdString &request, bool allowRetry)
{
- CStdString valStr = GetString(request);
+ CStdString valStr = GetString(request, allowRetry);
long val = strtol(valStr, 0, 10);
return val;
}
-long long Socket::GetLL(const CStdString &request)
+long long Socket::GetLL(const CStdString &request, bool allowRetry)
{
- CStdString valStr = GetString(request);
+ CStdString valStr = GetString(request, allowRetry);
#ifdef TARGET_WINDOWS
long long val = _strtoi64(valStr, 0, 10);
#else
View
10 addons/pvr.wmc/src/Socket.h
@@ -264,11 +264,11 @@ class Socket
void SetServerName(CStdString strServerName);
void SetClientName(CStdString strClientName);
void SetServerPort(int port);
- std::vector<CStdString> GetVector(const CStdString &request);
- CStdString GetString(const CStdString &request);
- bool GetBool(const CStdString &request);
- int GetInt(const CStdString &request);
- long long GetLL(const CStdString &request);
+ std::vector<CStdString> GetVector(const CStdString &request, bool allowRetry);
+ CStdString GetString(const CStdString &request, bool allowRetry);
+ bool GetBool(const CStdString &request, bool allowRetry);
+ int GetInt(const CStdString &request, bool allowRetry);
+ long long GetLL(const CStdString &request, bool allowRetry);
void SetTimeOut(int tSec);
};
View
2  addons/pvr.wmc/src/client.cpp
@@ -294,7 +294,7 @@ extern "C" {
pCapabilities->bSupportsTimers = true;
pCapabilities->bSupportsTV = true;
pCapabilities->bSupportsRadio = false;
- pCapabilities->bSupportsChannelGroups = false;
+ pCapabilities->bSupportsChannelGroups = true;
pCapabilities->bHandlesInputStream = true;
pCapabilities->bHandlesDemuxing = false;
pCapabilities->bSupportsChannelScan = false;
View
2  addons/pvr.wmc/src/clientversion.h
@@ -22,5 +22,5 @@
inline CStdString PVRWMC_GetClientVersion()
{
- return "0.2.92"; // ALSO CHANGE IN REV NUMBER in 'addon.xml.in'
+ return "0.2.93"; // ALSO CHANGE IN REV NUMBER in 'addon.xml.in'
}
View
162 addons/pvr.wmc/src/pvr2wmc.cpp
@@ -72,13 +72,13 @@ bool Pvr2Wmc::IsServerDown()
CStdString request;
request.Format("GetServiceStatus|%s|%s", PVRWMC_GetClientVersion(), g_clientOS);
_socketClient.SetTimeOut(10); // set a timout interval for checking if server is down
- bool res = _socketClient.GetBool(request);
+ bool res = _socketClient.GetBool(request, true);
return !res;
}
void Pvr2Wmc::UnLoading()
{
- _socketClient.GetBool("ClientGoingDown"); // returns true if server is up
+ _socketClient.GetBool("ClientGoingDown", true); // returns true if server is up
}
const char *Pvr2Wmc::GetBackendVersion(void)
@@ -87,7 +87,7 @@ const char *Pvr2Wmc::GetBackendVersion(void)
{
CStdString request;
request.Format("GetServerVersion");
- vector<CStdString> results = _socketClient.GetVector(request);
+ vector<CStdString> results = _socketClient.GetVector(request, true);
if (results.size() > 1)
{
_serverBuild = atoi(results[1]);
@@ -99,7 +99,7 @@ const char *Pvr2Wmc::GetBackendVersion(void)
int Pvr2Wmc::GetChannelsAmount(void)
{
- return _socketClient.GetInt("GetChannelCount");
+ return _socketClient.GetInt("GetChannelCount", true);
}
// test for returned error vector from server, handle accompanying messages if any
@@ -148,7 +148,7 @@ PVR_ERROR Pvr2Wmc::GetChannels(ADDON_HANDLE handle, bool bRadio)
if (IsServerDown())
return PVR_ERROR_SERVER_ERROR;
- vector<CStdString> results = _socketClient.GetVector("GetChannels");
+ vector<CStdString> results = _socketClient.GetVector("GetChannels", true);
FOREACH(response, results)
{
@@ -157,6 +157,13 @@ PVR_ERROR Pvr2Wmc::GetChannels(ADDON_HANDLE handle, bool bRadio)
memset(&xChannel, 0, sizeof(PVR_CHANNEL)); // set all mem to zero
vector<CStdString> v = split(*response, "|");
// packing: id, bradio, c.OriginalNumber, c.CallSign, c.IsEncrypted, imageStr, c.IsBlocked
+
+ if (v.size() < 7)
+ {
+ XBMC->Log(LOG_DEBUG, "Wrong number of fields xfered for channel group data");
+ continue;
+ }
+
xChannel.iUniqueId = strtoul(v[0].c_str(), 0, 10); // convert to unsigned int
xChannel.bIsRadio = Str2Bool(v[1]);
xChannel.iChannelNumber = atoi(v[2].c_str());
@@ -176,25 +183,35 @@ PVR_ERROR Pvr2Wmc::GetChannels(ADDON_HANDLE handle, bool bRadio)
int Pvr2Wmc::GetChannelGroupsAmount(void)
{
- //return _groups.size(); !!!
- return 1;
+ return _socketClient.GetInt("GetChannelGroupCount", true);
}
PVR_ERROR Pvr2Wmc::GetChannelGroups(ADDON_HANDLE handle, bool bRadio)
{
- for (unsigned int iGroupPtr = 0; iGroupPtr < _groups.size(); iGroupPtr++)
- {
- PVR_CHANNELGroup &group = _groups.at(iGroupPtr);
- if (group.bRadio == bRadio)
- {
- PVR_CHANNEL_GROUP xbmcGroup;
- memset(&xbmcGroup, 0, sizeof(PVR_CHANNEL_GROUP));
+ if (IsServerDown())
+ return PVR_ERROR_SERVER_ERROR;
+
+ CStdString request;
+ request.Format("GetChannelGroups|%s", bRadio ? "True" : "False");
+ vector<CStdString> results = _socketClient.GetVector(request, true);
- xbmcGroup.bIsRadio = bRadio;
- strncpy(xbmcGroup.strGroupName, group.strGroupName.c_str(), sizeof(xbmcGroup.strGroupName) - 1);
+ FOREACH(response, results)
+ {
+ PVR_CHANNEL_GROUP xGroup;
+ memset(&xGroup, 0, sizeof(PVR_CHANNEL_GROUP));
- PVR->TransferChannelGroup(handle, &xbmcGroup);
+ vector<CStdString> v = split(*response, "|");
+
+ if (v.size() < 1)
+ {
+ XBMC->Log(LOG_DEBUG, "Wrong number of fields xfered for channel group data");
+ continue;
}
+
+ xGroup.bIsRadio = bRadio;
+ strncpy(xGroup.strGroupName, v[0].c_str(), sizeof(xGroup.strGroupName) - 1);
+
+ PVR->TransferChannelGroup(handle, &xGroup);
}
return PVR_ERROR_NO_ERROR;
@@ -202,27 +219,31 @@ PVR_ERROR Pvr2Wmc::GetChannelGroups(ADDON_HANDLE handle, bool bRadio)
PVR_ERROR Pvr2Wmc::GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP &group)
{
- for (unsigned int iGroupPtr = 0; iGroupPtr < _groups.size(); iGroupPtr++)
- {
- PVR_CHANNELGroup &myGroup = _groups.at(iGroupPtr);
- if (!strcmp(myGroup.strGroupName.c_str(),group.strGroupName))
+ if (IsServerDown())
+ return PVR_ERROR_SERVER_ERROR;
+
+ CStdString request;
+ request.Format("GetChannelGroupMembers|%s|%s", group.bIsRadio ? "True" : "False", group.strGroupName);
+ vector<CStdString> results = _socketClient.GetVector(request, true);
+
+ FOREACH(response, results)
+ {
+ PVR_CHANNEL_GROUP_MEMBER xGroupMember;
+ memset(&xGroupMember, 0, sizeof(PVR_CHANNEL_GROUP_MEMBER));
+
+ vector<CStdString> v = split(*response, "|");
+
+ if (v.size() < 2)
{
- for (unsigned int iChannelPtr = 0; iChannelPtr < myGroup.members.size(); iChannelPtr++)
- {
- int iId = myGroup.members.at(iChannelPtr) - 1;
- if (iId < 0 || iId > (int)_channels.size() - 1)
- continue;
- PVR_CHANNEL &channel = _channels.at(iId);
- PVR_CHANNEL_GROUP_MEMBER xbmcGroupMember;
- memset(&xbmcGroupMember, 0, sizeof(PVR_CHANNEL_GROUP_MEMBER));
-
- strncpy(xbmcGroupMember.strGroupName, group.strGroupName, sizeof(xbmcGroupMember.strGroupName) - 1);
- xbmcGroupMember.iChannelUniqueId = channel.iUniqueId;
- xbmcGroupMember.iChannelNumber = channel.iChannelNumber;
-
- PVR->TransferChannelGroupMember(handle, &xbmcGroupMember);
- }
+ XBMC->Log(LOG_DEBUG, "Wrong number of fields xfered for channel group member data");
+ continue;
}
+
+ strncpy(xGroupMember.strGroupName, group.strGroupName, sizeof(xGroupMember.strGroupName) - 1);
+ xGroupMember.iChannelUniqueId = strtoul(v[0].c_str(), 0, 10); // convert to unsigned int
+ xGroupMember.iChannelNumber = atoi(v[1].c_str());
+
+ PVR->TransferChannelGroupMember(handle, &xGroupMember);
}
return PVR_ERROR_NO_ERROR;
@@ -234,9 +255,9 @@ PVR_ERROR Pvr2Wmc::GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &chan
return PVR_ERROR_SERVER_ERROR;
CStdString request;
- request.Format("GetEntries|%d|%d|%d", channel.iUniqueId, iStart, iEnd); // build the request string
+ request.Format("GetEntries|%d|%d|%d", channel.iUniqueId, iStart, iEnd); // build the request string
- vector<CStdString> results = _socketClient.GetVector(request); // get entries from server
+ vector<CStdString> results = _socketClient.GetVector(request, true); // get entries from server
FOREACH(response, results)
{
@@ -246,8 +267,8 @@ PVR_ERROR Pvr2Wmc::GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &chan
if (v.size() < 16)
{
- XBMC->Log(LOG_DEBUG, "Wrong number of field xfered for epg data");
- return PVR_ERROR_NO_ERROR;
+ XBMC->Log(LOG_DEBUG, "Wrong number of fields xfered for epg data");
+ continue;
}
// e.Id, e.Program.Title, c.OriginalNumber, start_t, end_t,
@@ -283,7 +304,7 @@ PVR_ERROR Pvr2Wmc::GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &chan
// timer functions -------------------------------------------------------------
int Pvr2Wmc::GetTimersAmount(void)
{
- return _socketClient.GetInt("GetTimerCount");
+ return _socketClient.GetInt("GetTimerCount", true);
}
#ifdef TARGET_WINDOWS
@@ -344,7 +365,7 @@ PVR_ERROR Pvr2Wmc::AddTimer(const PVR_TIMER &xTmr)
command = "GetShowInfo" + timerStr; // request data about the show that will be recorded by the timer
vector<CStdString> info; // holds results from server
- info = _socketClient.GetVector(command); // get results from server
+ info = _socketClient.GetVector(command, true); // get results from server
if (isServerError(info))
{
@@ -356,6 +377,13 @@ PVR_ERROR Pvr2Wmc::AddTimer(const PVR_TIMER &xTmr)
if (isSeries) // if the show is a series, next string contains record params for series
{
vector<CStdString> v = split(info[1].c_str(), "|"); // split to unpack string containing series params
+
+ if (v.size() < 7)
+ {
+ XBMC->Log(LOG_DEBUG, "Wrong number of fields xfered for AddTimer data");
+ return PVR_ERROR_NO_ERROR;
+ }
+
// fill in params for dialog windows
recSeries = v[0] == "True"; // get reset of params for dialog windows
runType = atoi(v[1].c_str()); // any=0, firstRun=1, live=2
@@ -396,7 +424,7 @@ PVR_ERROR Pvr2Wmc::AddTimer(const PVR_TIMER &xTmr)
command.append(extra);
- vector<CStdString> results = _socketClient.GetVector(command); // get results from server
+ vector<CStdString> results = _socketClient.GetVector(command, false); // get results from server
PVR->TriggerTimerUpdate(); // update timers regardless of whether there is an error
@@ -487,7 +515,7 @@ PVR_ERROR Pvr2Wmc::DeleteTimer(const PVR_TIMER &xTmr, bool bForceDelete)
eStr.Format("|%d", deleteSeries);
command.append(eStr);
- vector<CStdString> results = _socketClient.GetVector(command); // get results from server
+ vector<CStdString> results = _socketClient.GetVector(command, false); // get results from server
PVR->TriggerTimerUpdate(); // update timers regardless of whether there is an error
@@ -510,7 +538,7 @@ PVR_ERROR Pvr2Wmc::GetTimers(ADDON_HANDLE handle)
if (IsServerDown())
return PVR_ERROR_SERVER_ERROR;
- vector<CStdString> responses = _socketClient.GetVector("GetTimers");
+ vector<CStdString> responses = _socketClient.GetVector("GetTimers", true);
FOREACH(response, responses)
{
@@ -521,6 +549,13 @@ PVR_ERROR Pvr2Wmc::GetTimers(ADDON_HANDLE handle)
// eId, chId, start_t, end_t, pState,
// rp.Program.Title, ""/*recdir*/, rp.Program.EpisodeTitle/*summary?*/, rp.Priority, rp.Request.IsRecurring,
// eId, preMargin, postMargin, genre, subgenre
+
+ if (v.size() < 15)
+ {
+ XBMC->Log(LOG_DEBUG, "Wrong number of fields xfered for timer data");
+ continue;
+ }
+
xTmr.iClientIndex = atoi(v[0].c_str()); // timer index (set to same as Entry ID)
xTmr.iClientChannelUid = atoi(v[1].c_str()); // channel id
xTmr.startTime = atoi(v[2].c_str()); // start time
@@ -553,7 +588,7 @@ PVR_ERROR Pvr2Wmc::GetTimers(ADDON_HANDLE handle)
// recording functions ------------------------------------------------------------------------
int Pvr2Wmc::GetRecordingsAmount(void)
{
- return _socketClient.GetInt("GetRecordingsAmount");
+ return _socketClient.GetInt("GetRecordingsAmount", true);
}
// recording file functions
@@ -562,7 +597,7 @@ PVR_ERROR Pvr2Wmc::GetRecordings(ADDON_HANDLE handle)
if (IsServerDown())
return PVR_ERROR_SERVER_ERROR;
- vector<CStdString> responses = _socketClient.GetVector("GetRecordings");
+ vector<CStdString> responses = _socketClient.GetVector("GetRecordings", true);
FOREACH(response, responses)
{
@@ -575,6 +610,12 @@ PVR_ERROR Pvr2Wmc::GetRecordings(ADDON_HANDLE handle)
// plot, r.Channel.CallSign, ""/*icon path*/, ""/*thumbnail path*/, ToTime_t(r.RecordingTime),
// duration, r.RequestedProgram.Priority, r.KeepLength.ToString(), genre, subgenre
+ if (v.size() < 16)
+ {
+ XBMC->Log(LOG_DEBUG, "Wrong number of fields xfered for recording data");
+ continue;
+ }
+
STRCPY(xRec.strRecordingId, v[0].c_str());
STRCPY(xRec.strTitle, v[1].c_str());
STRCPY(xRec.strStreamURL, v[2].c_str());
@@ -593,7 +634,6 @@ PVR_ERROR Pvr2Wmc::GetRecordings(ADDON_HANDLE handle)
if (g_bEnableMultiResume)
xRec.iLastPlayedPosition = atoi(v[15].c_str());
-
PVR->TransferRecordingEntry(handle, &xRec);
}
@@ -610,7 +650,7 @@ PVR_ERROR Pvr2Wmc::DeleteRecording(const PVR_RECORDING &recording)
CStdString command;// = format("DeleteRecording|%s|%s|%s", recording.strRecordingId, recording.strTitle, recording.strStreamURL);
command.Format("DeleteRecording|%s|%s|%s", recording.strRecordingId, recording.strTitle, recording.strStreamURL);
- vector<CStdString> results = _socketClient.GetVector(command); // get results from server
+ vector<CStdString> results = _socketClient.GetVector(command, false); // get results from server
if (isServerError(results)) // did the server do it?
@@ -639,7 +679,7 @@ PVR_ERROR Pvr2Wmc::RenameRecording(const PVR_RECORDING &recording)
CStdString command;// = format("RenameRecording|%s|%s", recording.strRecordingId, recording.strTitle);
command.Format("RenameRecording|%s|%s", recording.strRecordingId, recording.strTitle);
- vector<CStdString> results = _socketClient.GetVector(command); // get results from server
+ vector<CStdString> results = _socketClient.GetVector(command, false); // get results from server
if (isServerError(results)) // did the server do it?
{
@@ -658,7 +698,7 @@ PVR_ERROR Pvr2Wmc::SetRecordingLastPlayedPosition(const PVR_RECORDING &recording
{
CStdString command;
command.Format("SetResumePosition|%s|%d", recording.strRecordingId, lastplayedposition);
- vector<CStdString> results = _socketClient.GetVector(command);
+ vector<CStdString> results = _socketClient.GetVector(command, false);
PVR->TriggerRecordingUpdate(); // this is needed to get the new resume point actually used by the player (xbmc bug)
return PVR_ERROR_NO_ERROR;
}
@@ -670,7 +710,7 @@ int Pvr2Wmc::GetRecordingLastPlayedPosition(const PVR_RECORDING &recording)
{
CStdString command;
command.Format("GetResumePosition|%s", recording.strRecordingId);
- int pos = _socketClient.GetInt(command);
+ int pos = _socketClient.GetInt(command, true);
return pos;
}
@@ -695,7 +735,7 @@ bool Pvr2Wmc::OpenLiveStream(const PVR_CHANNEL &channel)
CloseLiveStream(false); // close current stream (if any)
CStdString request = "OpenLiveStream" + Channel2String(channel); // request a live stream using channel
- vector<CStdString> results = _socketClient.GetVector(request); // try to open live stream, get path to stream file
+ vector<CStdString> results = _socketClient.GetVector(request, false); // try to open live stream, get path to stream file
if (isServerError(results)) // test if server reported an error
{
@@ -734,7 +774,7 @@ bool Pvr2Wmc::OpenLiveStream(const PVR_CHANNEL &channel)
#endif
XBMC->Log(LOG_ERROR, lastError.c_str()); // log more info on error
- _socketClient.GetBool("StreamStartError|" + _streamFileName); // tell server stream did not start
+ _socketClient.GetBool("StreamStartError|" + _streamFileName, true); // tell server stream did not start
return false;
}
@@ -754,7 +794,7 @@ bool Pvr2Wmc::OpenLiveStream(const PVR_CHANNEL &channel)
bool Pvr2Wmc::SwitchChannel(const PVR_CHANNEL &channel)
{
CStdString request = "SwitchChannel|" + g_strClientName + Channel2String(channel); // request a live stream using channel
- return _socketClient.GetBool(request); // try to open live stream, get path to stream file
+ return _socketClient.GetBool(request, false); // try to open live stream, get path to stream file
}
// read from the live stream file opened in OpenLiveStream
@@ -865,7 +905,7 @@ bool Pvr2Wmc::CheckErrorOnServer()
CStdString request;
request.Format("CheckError");
//request.Format("CheckError|%d|%d|%d", checkCnt, (long)streamPos, (long)streamfileSize);
- vector<CStdString> results = _socketClient.GetVector(request); // see if server posted an error for active stream
+ vector<CStdString> results = _socketClient.GetVector(request, true); // see if server posted an error for active stream
return isServerError(results);
}
return false;
@@ -910,7 +950,7 @@ long long Pvr2Wmc::ActualFileSize(int count)
{
CStdString request;
request.Format("StreamFileSize|%d", count); // request stream size form client, passing number of consecutive queries
- lFileSize = _socketClient.GetLL(request);
+ lFileSize = _socketClient.GetLL(request, true);
if (lFileSize < -1) // if server returns a negative file size, it means the stream file is no longer growing (-1 => error)
{
@@ -949,7 +989,7 @@ bool Pvr2Wmc::CloseLiveStream(bool notifyServer /*=true*/)
if (notifyServer)
{
- return _socketClient.GetBool("CloseLiveStream"); // tell server to close down stream
+ return _socketClient.GetBool("CloseLiveStream", false); // tell server to close down stream
}
else
return true;
@@ -967,7 +1007,7 @@ bool Pvr2Wmc::OpenRecordedStream(const PVR_RECORDING &recording)
// request an active recording stream
CStdString request;// = format("OpenRecordingStream|%s", recording.strRecordingId);
request.Format("OpenRecordingStream|%s", recording.strRecordingId);
- vector<CStdString> results = _socketClient.GetVector(request); // try to open recording stream, get path to stream file
+ vector<CStdString> results = _socketClient.GetVector(request, false); // try to open recording stream, get path to stream file
if (isServerError(results)) // test if server reported an error
{
@@ -998,7 +1038,7 @@ bool Pvr2Wmc::OpenRecordedStream(const PVR_RECORDING &recording)
lastError.Format("Error opening stream file");
#endif
XBMC->Log(LOG_ERROR, lastError.c_str()); // log more info on error
- _socketClient.GetBool("StreamStartError|" + _streamFileName); // tell server stream did not start
+ _socketClient.GetBool("StreamStartError|" + _streamFileName, true); // tell server stream did not start
return false;
}
else
@@ -1033,7 +1073,7 @@ PVR_ERROR Pvr2Wmc::SignalStatus(PVR_SIGNAL_STATUS &signalStatus)
CStdString command;
command.Format("SignalStatus");
- vector<CStdString> results = _socketClient.GetVector(command); // get results from server
+ vector<CStdString> results = _socketClient.GetVector(command, true); // get results from server
// strDeviceName, strDeviceStatus, strProvider, strService, strMux
// iSignal, dVideoBitrate, dAudioBitrate, Error
Please sign in to comment.
Something went wrong with that request. Please try again.