Skip to content

Commit

Permalink
do not wait for 'subscriptionChangeWeight' response
Browse files Browse the repository at this point in the history
  • Loading branch information
Glenn-1990 committed Jul 26, 2015
1 parent e083c39 commit 8b2cea2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/HTSPConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,14 @@ htsmsg_t *CHTSPConnection::SendAndWait0 ( const char *method, htsmsg_t *msg, int
}

/* Wait for response */
msg = resp.Get(m_mutex, iResponseTimeout);
msg = resp.Get(m_mutex, iResponseTimeout > 0 ? iResponseTimeout : 1);
m_messages.erase(seq);

/* No response needed */
if (!iResponseTimeout && !msg)
return NULL;

/* No response received */
if (!msg)
{
//XBMC->QueueNotification(QUEUE_ERROR, "Command %s failed: No response received", method);
Expand Down
5 changes: 3 additions & 2 deletions src/HTSPDemuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,9 @@ void CHTSPDemuxer::SendWeight ( void )
htsmsg_add_s32(m, "weight", m_subscription.weight);
tvhdebug("demux send weight %u", m_subscription.weight);

/* Send and Wait */
m = m_conn.SendAndWait("subscriptionChangeWeight", m);
/* Send and don't wait for a response (timeout to 0) */
/* This because tvh doesn't seems to respond for dead subscriptions */
m = m_conn.SendAndWait("subscriptionChangeWeight", m, 0);
if (m)
htsmsg_destroy(m);
}
Expand Down

0 comments on commit 8b2cea2

Please sign in to comment.