zapit/src/zapit.cpp: move CBasicServer to class and prepare it in Start(),

comment leaveStandby at startup, to do it on command


Origin commit data
------------------
Branch: ni/coolstream
Commit: 3b8211e445
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-03-11 (Sun, 11 Mar 2012)



------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2012-03-11 14:26:13 +04:00
parent f9c5e02d97
commit 66dba5f15a
2 changed files with 12 additions and 4 deletions

View File

@@ -75,7 +75,9 @@ class CZapit : public OpenThreads::Thread
int video_mode;
Zapit_config config;
CConfigFile configfile;
CEventServer *eventServer;
CBasicServer zapit_server;
CZapitChannel * current_channel;
t_channel_id live_channel_id;

View File

@@ -27,6 +27,7 @@
#include <sys/poll.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <unistd.h>
#include <syscall.h>
@@ -741,6 +742,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
if ((standby) && ((rmsg.cmd != CZapitMessages::CMD_SET_VOLUME)
&& (rmsg.cmd != CZapitMessages::CMD_MUTE)
&& (rmsg.cmd != CZapitMessages::CMD_REGISTEREVENTS)
&& (rmsg.cmd != CZapitMessages::CMD_IS_TV_CHANNEL)
&& (rmsg.cmd != CZapitMessages::CMD_SET_STANDBY))) {
WARN("cmd %d in standby mode", rmsg.cmd);
@@ -2046,15 +2048,20 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg)
ca->Start();
eventServer = new CEventServer;
if (!zapit_server.prepare(ZAPIT_UDS_NAME)) {
perror(ZAPIT_UDS_NAME);
return false;
}
current_channel = CServiceManager::getInstance()->FindChannel(live_channel_id);
// some older? hw needs this sleep. e.g. my hd-1c.
// if sleep is not set -> blackscreen after boot.
// sleep(1) is ok here. (striper)
#if 0
sleep(1);
leaveStandby();
#endif
started = true;
int ret = start();
return (ret == 0);
@@ -2081,15 +2088,14 @@ void CZapit::run()
printf("[zapit] starting... tid %ld\n", syscall(__NR_gettid));
abort_zapit = 0;
#if 0
CBasicServer zapit_server;
if (!zapit_server.prepare(ZAPIT_UDS_NAME)) {
perror(ZAPIT_UDS_NAME);
return;
}
//pthread_create (&tsdt, NULL, sdt_thread, (void *) NULL);
#endif
SdtMonitor.Start();
while (started && zapit_server.run(zapit_parse_command, CZapitMessages::ACTVERSION, true))
{