mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-03 02:41:12 +02:00
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
------------------
Commit: 3b8211e445
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-03-11 (Sun, 11 Mar 2012)
This commit is contained in:
@@ -75,7 +75,9 @@ class CZapit : public OpenThreads::Thread
|
|||||||
int video_mode;
|
int video_mode;
|
||||||
Zapit_config config;
|
Zapit_config config;
|
||||||
CConfigFile configfile;
|
CConfigFile configfile;
|
||||||
|
|
||||||
CEventServer *eventServer;
|
CEventServer *eventServer;
|
||||||
|
CBasicServer zapit_server;
|
||||||
|
|
||||||
CZapitChannel * current_channel;
|
CZapitChannel * current_channel;
|
||||||
t_channel_id live_channel_id;
|
t_channel_id live_channel_id;
|
||||||
|
@@ -27,6 +27,7 @@
|
|||||||
#include <sys/poll.h>
|
#include <sys/poll.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <sys/time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <syscall.h>
|
#include <syscall.h>
|
||||||
|
|
||||||
@@ -741,6 +742,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
|
|||||||
|
|
||||||
if ((standby) && ((rmsg.cmd != CZapitMessages::CMD_SET_VOLUME)
|
if ((standby) && ((rmsg.cmd != CZapitMessages::CMD_SET_VOLUME)
|
||||||
&& (rmsg.cmd != CZapitMessages::CMD_MUTE)
|
&& (rmsg.cmd != CZapitMessages::CMD_MUTE)
|
||||||
|
&& (rmsg.cmd != CZapitMessages::CMD_REGISTEREVENTS)
|
||||||
&& (rmsg.cmd != CZapitMessages::CMD_IS_TV_CHANNEL)
|
&& (rmsg.cmd != CZapitMessages::CMD_IS_TV_CHANNEL)
|
||||||
&& (rmsg.cmd != CZapitMessages::CMD_SET_STANDBY))) {
|
&& (rmsg.cmd != CZapitMessages::CMD_SET_STANDBY))) {
|
||||||
WARN("cmd %d in standby mode", rmsg.cmd);
|
WARN("cmd %d in standby mode", rmsg.cmd);
|
||||||
@@ -2046,15 +2048,20 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg)
|
|||||||
ca->Start();
|
ca->Start();
|
||||||
|
|
||||||
eventServer = new CEventServer;
|
eventServer = new CEventServer;
|
||||||
|
if (!zapit_server.prepare(ZAPIT_UDS_NAME)) {
|
||||||
|
perror(ZAPIT_UDS_NAME);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
current_channel = CServiceManager::getInstance()->FindChannel(live_channel_id);
|
current_channel = CServiceManager::getInstance()->FindChannel(live_channel_id);
|
||||||
|
|
||||||
// some older? hw needs this sleep. e.g. my hd-1c.
|
// some older? hw needs this sleep. e.g. my hd-1c.
|
||||||
// if sleep is not set -> blackscreen after boot.
|
// if sleep is not set -> blackscreen after boot.
|
||||||
// sleep(1) is ok here. (striper)
|
// sleep(1) is ok here. (striper)
|
||||||
|
#if 0
|
||||||
sleep(1);
|
sleep(1);
|
||||||
leaveStandby();
|
leaveStandby();
|
||||||
|
#endif
|
||||||
started = true;
|
started = true;
|
||||||
int ret = start();
|
int ret = start();
|
||||||
return (ret == 0);
|
return (ret == 0);
|
||||||
@@ -2081,15 +2088,14 @@ void CZapit::run()
|
|||||||
printf("[zapit] starting... tid %ld\n", syscall(__NR_gettid));
|
printf("[zapit] starting... tid %ld\n", syscall(__NR_gettid));
|
||||||
|
|
||||||
abort_zapit = 0;
|
abort_zapit = 0;
|
||||||
|
#if 0
|
||||||
CBasicServer zapit_server;
|
CBasicServer zapit_server;
|
||||||
|
|
||||||
if (!zapit_server.prepare(ZAPIT_UDS_NAME)) {
|
if (!zapit_server.prepare(ZAPIT_UDS_NAME)) {
|
||||||
perror(ZAPIT_UDS_NAME);
|
perror(ZAPIT_UDS_NAME);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
//pthread_create (&tsdt, NULL, sdt_thread, (void *) NULL);
|
|
||||||
SdtMonitor.Start();
|
SdtMonitor.Start();
|
||||||
while (started && zapit_server.run(zapit_parse_command, CZapitMessages::ACTVERSION, true))
|
while (started && zapit_server.run(zapit_parse_command, CZapitMessages::ACTVERSION, true))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user