Skip to content

Commit

Permalink
[pvr.tvh] - minor formatting changes to PR opdenkamp#8
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsutton authored and herrnst committed Apr 26, 2014
1 parent 36a9741 commit 1bd7a10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
15 changes: 5 additions & 10 deletions addons/pvr.tvh/src/HTSPConnection.cpp
Expand Up @@ -497,7 +497,7 @@ void CHTSPConnection::Register ( void )
void* CHTSPConnection::Process ( void )
{
static bool log = false;
static unsigned int retryAttempt = 1;
static unsigned int retryAttempt = 0;

while (!IsStopped())
{
Expand Down Expand Up @@ -539,21 +539,16 @@ void* CHTSPConnection::Process ( void )
XBMC->QueueNotification(QUEUE_ERROR, "Unable to connect to %s:%d", host.c_str(), port);

// Retry a few times with a short interval, after that with the default timeout
int retryTimeout;

if (retryAttempt <= FAST_RECONNECT_TRIES)
retryTimeout = FAST_RECONNECT_INTERVAL;
if (++retryAttempt <= FAST_RECONNECT_ATTEMPTS)
Sleep(FAST_RECONNECT_INTERVAL);
else
retryTimeout = timeout;

Sleep(retryTimeout);
++retryAttempt;
Sleep(timeout);

continue;
}
tvhdebug("connected");
log = false;
retryAttempt = 1;
retryAttempt = 0;

/* Start connect thread */
m_regThread.CreateThread(true);
Expand Down
2 changes: 1 addition & 1 deletion addons/pvr.tvh/src/Tvheadend.h
Expand Up @@ -53,7 +53,7 @@ extern "C" {
* Configuration defines
*/
#define HTSP_API_VERSION 12
#define FAST_RECONNECT_TRIES 5
#define FAST_RECONNECT_ATTEMPTS 5
#define FAST_RECONNECT_INTERVAL 500 // ms

/*
Expand Down

0 comments on commit 1bd7a10

Please sign in to comment.