From c8e0610199bea50720bfbc88d7ea5d3106a1f73c Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 7 Oct 2013 16:58:41 +0400 Subject: [PATCH] zapit/src/zapit.cpp: prevent 'rotor moving' message for ZapForEpg Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/78fd4a1204d21f3787365fce2d45c1bf4d9071fd Author: [CST] Focus Date: 2013-10-07 (Mon, 07 Oct 2013) --- src/zapit/include/zapit/zapit.h | 2 +- src/zapit/src/zapit.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/zapit/include/zapit/zapit.h b/src/zapit/include/zapit/zapit.h index f236fc4be..2396c4d9b 100644 --- a/src/zapit/include/zapit/zapit.h +++ b/src/zapit/include/zapit/zapit.h @@ -158,7 +158,7 @@ class CZapit : public OpenThreads::Thread void RestoreChannelPids(CZapitChannel* channel); //void ConfigFrontend(); - bool TuneChannel(CFrontend *frontend, CZapitChannel * channel, bool &transponder_change); + bool TuneChannel(CFrontend *frontend, CZapitChannel * channel, bool &transponder_change, bool send_event = true); bool ParsePatPmt(CZapitChannel * channel); bool send_data_count(int connfd, int data_count); diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 7becbd740..6dcc2cc43 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -417,7 +417,7 @@ audio_map_set_t * CZapit::GetSavedPids(const t_channel_id channel_id) return NULL; } -bool CZapit::TuneChannel(CFrontend * frontend, CZapitChannel * channel, bool &transponder_change) +bool CZapit::TuneChannel(CFrontend * frontend, CZapitChannel * channel, bool &transponder_change, bool send_event) { if(channel == NULL || frontend == NULL) return false; @@ -427,7 +427,8 @@ bool CZapit::TuneChannel(CFrontend * frontend, CZapitChannel * channel, bool &tr int waitForMotor = frontend->driveToSatellitePosition(channel->getSatellitePosition()); if(waitForMotor > 0) { printf("[zapit] waiting %d seconds for motor to turn satellite dish.\n", waitForMotor); - SendEvent(CZapitClient::EVT_ZAP_MOTOR, &waitForMotor, sizeof(waitForMotor)); + if (send_event) + SendEvent(CZapitClient::EVT_ZAP_MOTOR, &waitForMotor, sizeof(waitForMotor)); for(int i = 0; i < waitForMotor; i++) { sleep(1); if(abort_zapit) { @@ -712,7 +713,7 @@ bool CZapit::ZapForEpg(const t_channel_id channel_id) ERROR("Cannot get frontend\n"); return false; } - if(!TuneChannel(frontend, newchannel, transponder_change)) + if(!TuneChannel(frontend, newchannel, transponder_change, false)) return false; #if 0 if(!ParsePatPmt(newchannel))