From 9be2206f155d4cff55d816e80d6275844cc33b3b Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Tue, 28 Oct 2014 13:48:02 +0100 Subject: [PATCH] fixed: don't call CEC_ALERT_CONNECTION_LOST when closing the connection, which caused a deadlock in XBMC. the lock needs to be solved in XBMC still for the odd situation in which this does occur on exit at the same time, but now it won't happen on each exit --- ChangeLog | 1 + debian/changelog | 1 + src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0cc765e..862c347 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ libcec (2.2.0-1) unstable; urgency=low credits: @ksooo * LibCecTray: keypress not sent when multiple instances of eshell.exe are running. thanks @pvanbaren + * deadlock on exit in XBMC, because of CEC_ALERT_CONNECTION_LOST -- Pulse-Eight Packaging Tue, 28 Oct 2014 10:45:00 +0200 diff --git a/debian/changelog b/debian/changelog index 0cc765e..862c347 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,7 @@ libcec (2.2.0-1) unstable; urgency=low credits: @ksooo * LibCecTray: keypress not sent when multiple instances of eshell.exe are running. thanks @pvanbaren + * deadlock on exit in XBMC, because of CEC_ALERT_CONNECTION_LOST -- Pulse-Eight Packaging Tue, 28 Oct 2014 10:45:00 +0200 diff --git a/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp b/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp index 0373595..1be07c5 100644 --- a/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp +++ b/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp @@ -710,7 +710,7 @@ void *CAdapterPingThread::Process(void) /* send a ping to the adapter */ bool bPinged(false); int iFailedCounter(0); - while (!bPinged && iFailedCounter < 3) + while (!bPinged && iFailedCounter < 3 && !IsStopped()) { if (!m_com->PingAdapter()) { @@ -724,7 +724,7 @@ void *CAdapterPingThread::Process(void) } } - if (iFailedCounter == 3) + if (iFailedCounter == 3 && !IsStopped()) { /* failed to ping the adapter 3 times in a row. something must be wrong with the connection */ m_com->LIB_CEC->AddLog(CEC_LOG_ERROR, "failed to ping the adapter 3 times in a row. closing the connection."); -- 2.34.1