From e936d40b1f695badf0d97fd2390ce662f5419d3d Mon Sep 17 00:00:00 2001 From: phintuka Date: Wed, 28 Mar 2007 14:40:10 +0000 Subject: Initialization timeouts --- device.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'device.c') diff --git a/device.c b/device.c index f1261b75..54e612c6 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.35 2007-03-14 17:40:38 phintuka Exp $ + * $Id: device.c,v 1.36 2007-03-28 14:40:10 phintuka Exp $ * */ @@ -241,6 +241,7 @@ bool cXinelibDevice::StartDevice() // if(dynamic_cast(it)) if(m_local) { + int timer = 0; m_local->Start(); while(!m_local->IsReady()) { cCondWait::SleepMs(100); @@ -248,12 +249,17 @@ bool cXinelibDevice::StartDevice() LOGMSG("cXinelibDevice::Start(): Local frontend init failed"); return false; } + if(++timer >= 7*10) { + LOGMSG("cXinelibDevice::Start(): Local frontend init timeout"); + return false; + } } if(xc.force_primary_device) ForcePrimaryDevice(true); } if(m_server) { + int timer = 0; m_server->Start(); while(!m_server->IsReady()) { cCondWait::SleepMs(100); @@ -261,6 +267,10 @@ bool cXinelibDevice::StartDevice() LOGMSG("cXinelibDevice::Start(): Server init failed"); return false; } + if(++timer >= 5*10) { + LOGMSG("cXinelibDevice::Start(): Server init timeout"); + return false; + } } } -- cgit v1.2.3