From 60e8d0dbf9661cca9b33e36968d1d5b20984d65a Mon Sep 17 00:00:00 2001 From: phintuka Date: Sun, 30 Sep 2007 09:19:11 +0000 Subject: Increase local frontend initialization timeout (Thanks to Mikko Vartiainen) Start local frontend and remote server in paraller --- device.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'device.c') diff --git a/device.c b/device.c index db2a094b..fad58e7b 100644 --- a/device.c +++ b/device.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: device.c,v 1.40 2007-09-17 23:29:22 phintuka Exp $ + * $Id: device.c,v 1.41 2007-09-30 09:19:11 phintuka Exp $ * */ @@ -41,6 +41,8 @@ #include "device.h" #define STILLPICTURE_REPEAT_COUNT 3 +#define LOCAL_INIT_TIMEOUT 20 // seconds +#define SERVER_INIT_TIMEOUT 5 // seconds //---------------------------- status monitor ------------------------------- @@ -240,17 +242,21 @@ bool cXinelibDevice::StartDevice() { TRACEF("cXinelibDevice::StartDevice"); + if(m_local) + m_local->Start(); + if(m_server) + m_server->Start(); + // if(dynamic_cast(it)) if(m_local) { int timer = 0; - m_local->Start(); while(!m_local->IsReady()) { cCondWait::SleepMs(100); if(m_local->IsFinished()) { LOGMSG("cXinelibDevice::Start(): Local frontend init failed"); return false; } - if(++timer >= 7*10) { + if(++timer >= LOCAL_INIT_TIMEOUT*10) { LOGMSG("cXinelibDevice::Start(): Local frontend init timeout"); return false; } @@ -261,14 +267,13 @@ bool cXinelibDevice::StartDevice() if(m_server) { int timer = 0; - m_server->Start(); while(!m_server->IsReady()) { cCondWait::SleepMs(100); if(m_server->IsFinished()) { LOGMSG("cXinelibDevice::Start(): Server init failed"); return false; } - if(++timer >= 5*10) { + if(++timer >= SERVER_INIT_TIMEOUT*10) { LOGMSG("cXinelibDevice::Start(): Server init timeout"); return false; } -- cgit v1.2.3