From e0d1b7f375e765c841bc3ee361827cb8f9798d15 Mon Sep 17 00:00:00 2001 From: focus Date: Fri, 18 Nov 2011 14:43:56 +0000 Subject: [PATCH] async CZapitMessages::CMD_RELOAD_CURRENTSERVICES as different way to resolve dead-lock after scan, for testing git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1864 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/zapit/lib/zapitclient.cpp | 3 ++- src/zapit/src/scan.cpp | 8 ++++++++ src/zapit/src/zapit.cpp | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/zapit/lib/zapitclient.cpp b/src/zapit/lib/zapitclient.cpp index 98acf56fc..588249d55 100644 --- a/src/zapit/lib/zapitclient.cpp +++ b/src/zapit/lib/zapitclient.cpp @@ -469,9 +469,10 @@ void CZapitClient::reinitChannels() void CZapitClient::reloadCurrentServices() { send(CZapitMessages::CMD_RELOAD_CURRENTSERVICES); - +#if 0 CZapitMessages::responseCmd response; CBasicClient::receive_data((char* )&response, sizeof(response), true); +#endif close_connection(); } diff --git a/src/zapit/src/scan.cpp b/src/zapit/src/scan.cpp index bcf85cc73..26fef3179 100644 --- a/src/zapit/src/scan.cpp +++ b/src/zapit/src/scan.cpp @@ -562,6 +562,9 @@ bool CServiceScan::ScanProviders() g_bouquetManager->loadBouquets(); printf("[scan] save bouquets done\n"); Cleanup(true); +#if 1 + myZapitClient.reloadCurrentServices(); +#else /* this can hang as the thread handling the connections * could already be in g_Zapit->stopScan(), waiting for * *this* thread to join(). @@ -572,6 +575,7 @@ bool CServiceScan::ScanProviders() t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); CZapit::getInstance()->ZapIt(live_channel_id, false); CZapit::getInstance()->SendEvent(CZapitClient::EVT_SERVICES_CHANGED); +#endif } else { Cleanup(false); CFrontend::getInstance()->setTsidOnid(0); @@ -634,6 +638,9 @@ bool CServiceScan::ScanTransponder() //g_bouquetManager->clearAll(); g_bouquetManager->loadBouquets(); Cleanup(true); +#if 1 + myZapitClient.reloadCurrentServices(); +#else /* see the explanation in CServiceScan::ScanProviders() in why this is a bad idea myZapitClient.reloadCurrentServices(); */ @@ -641,6 +648,7 @@ bool CServiceScan::ScanTransponder() t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); CZapit::getInstance()->ZapIt(live_channel_id, false); CZapit::getInstance()->SendEvent(CZapitClient::EVT_SERVICES_CHANGED); +#endif } else { Cleanup(false); CFrontend::getInstance()->setTsidOnid(0); diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index f03ac8421..ce155eefe 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -956,8 +956,10 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) } case CZapitMessages::CMD_RELOAD_CURRENTSERVICES: { +#if 0 response.cmd = CZapitMessages::CMD_READY; CBasicServer::send_data(connfd, &response, sizeof(response)); +#endif DBG("[zapit] sending EVT_SERVICES_CHANGED\n"); CFrontend::getInstance()->setTsidOnid(0); ZapIt(live_channel_id, current_is_nvod);