diff options
author | phintuka <phintuka> | 2007-01-26 18:12:40 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2007-01-26 18:12:40 +0000 |
commit | 47974d192c66cce8350697dadbd3d81f791b40e7 (patch) | |
tree | 108df4e2c31ee751fe0bb9cdafbc054802b161f1 | |
parent | 137897018f2c856c635d23cc6434cd44798df00b (diff) | |
download | xineliboutput-47974d192c66cce8350697dadbd3d81f791b40e7.tar.gz xineliboutput-47974d192c66cce8350697dadbd3d81f791b40e7.tar.bz2 |
Avoid busy Poll loops when frontend not ready
-rw-r--r-- | frontend.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend.c,v 1.30 2007-01-24 04:32:15 phintuka Exp $ + * $Id: frontend.c,v 1.31 2007-01-26 18:12:40 phintuka Exp $ * */ @@ -194,6 +194,7 @@ cXinelibThread::~cXinelibThread() { TRACEF("cXinelibThread::~cXinelibThread"); + m_bStopThread = true; if(Active()) Cancel(); if(m_FileName) @@ -351,6 +352,13 @@ int cXinelibThread::Poll(cPoller& Poller, int TimeoutMs) { TRACEF("cXinelibThread::Poll"); + if(!m_bReady) { + if(TimeoutMs>0) + cCondWait::SleepMs(TimeoutMs); + if(!m_bReady) + return 0; + } + int n = Xine_Control("POLL", TimeoutMs); return max(n, 0); |