summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2007-01-26 18:12:40 +0000
committerphintuka <phintuka>2007-01-26 18:12:40 +0000
commit47974d192c66cce8350697dadbd3d81f791b40e7 (patch)
tree108df4e2c31ee751fe0bb9cdafbc054802b161f1
parent137897018f2c856c635d23cc6434cd44798df00b (diff)
downloadxineliboutput-47974d192c66cce8350697dadbd3d81f791b40e7.tar.gz
xineliboutput-47974d192c66cce8350697dadbd3d81f791b40e7.tar.bz2
Avoid busy Poll loops when frontend not ready
-rw-r--r--frontend.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/frontend.c b/frontend.c
index a13f89b1..b93cb7e7 100644
--- a/frontend.c
+++ b/frontend.c
@@ -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);