Skip to content

Commit

Permalink
xbmc-pvr: add upstream patches
Browse files Browse the repository at this point in the history
Signed-off-by: Stephan Raue <stephan@openelec.tv>
  • Loading branch information
sraue committed Jan 4, 2012
1 parent 72dcb16 commit 5c98937
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
@@ -0,0 +1,38 @@
From 994a4cb70a9437105ef9c176d5d79939382d22e8 Mon Sep 17 00:00:00 2001
From: Gregor Fuis <gregor.fuis@gmail.com>
Date: Mon, 2 Jan 2012 17:13:54 +0100
Subject: [PATCH] tvheadend pvr client: retry connecting within timout

---
xbmc/pvrclients/tvheadend/HTSPConnection.cpp | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/xbmc/pvrclients/tvheadend/HTSPConnection.cpp b/xbmc/pvrclients/tvheadend/HTSPConnection.cpp
index 5f5865d..4adb45b 100644
--- a/xbmc/pvrclients/tvheadend/HTSPConnection.cpp
+++ b/xbmc/pvrclients/tvheadend/HTSPConnection.cpp
@@ -57,12 +57,20 @@ bool CHTSPConnection::Connect()
if (m_bIsConnected)
return true;

+ cTimeMs RetryTimeout;
char errbuf[1024];
int errlen = sizeof(errbuf);

XBMC->Log(LOG_DEBUG, "%s - connecting to '%s', port '%d'", __FUNCTION__, m_strHostname.c_str(), m_iPortnumber);

- m_fd = tcp_connect(m_strHostname.c_str(), m_iPortnumber, errbuf, errlen, m_iConnectTimeout);
+ m_fd = INVALID_SOCKET;
+ while (m_fd == INVALID_SOCKET && RetryTimeout.Elapsed() < (uint)m_iConnectTimeout * 1000)
+ {
+ m_fd = tcp_connect(m_strHostname.c_str(), m_iPortnumber, errbuf, errlen,
+ m_iConnectTimeout * 1000 - RetryTimeout.Elapsed());
+ cCondWait::SleepMs(100);
+ }
+
if(m_fd == INVALID_SOCKET)
{
XBMC->Log(LOG_ERROR, "%s - failed to connect to the backend (%s)", __FUNCTION__, errbuf);
--
1.7.5.4

@@ -0,0 +1,30 @@
From 949162c47809bb7e9ae2e2b24aad7776a737ecc4 Mon Sep 17 00:00:00 2001
From: Lars Op den Kamp <lars@opdenkamp.eu>
Date: Tue, 3 Jan 2012 02:09:37 +0100
Subject: [PATCH] pvr: remove deleted channels from the internal group too.
closes #366

---
xbmc/pvr/channels/PVRChannelGroup.cpp | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/xbmc/pvr/channels/PVRChannelGroup.cpp b/xbmc/pvr/channels/PVRChannelGroup.cpp
index 9748fb0..0f74527 100644
--- a/xbmc/pvr/channels/PVRChannelGroup.cpp
+++ b/xbmc/pvr/channels/PVRChannelGroup.cpp
@@ -608,11 +608,8 @@ bool CPVRChannelGroup::RemoveDeletedChannels(const CPVRChannelGroup &channels)
/* since it was not found in the internal group, it was deleted from the backend */
channel->Delete();
}
- else
- {
- erase(begin() + iChannelPtr);
- }

+ erase(begin() + iChannelPtr);
m_bChanged = true;
bReturn = true;
}
--
1.7.5.4

0 comments on commit 5c98937

Please sign in to comment.