From 1bbd8487432cf3de45b847d56b989df1d451884e Mon Sep 17 00:00:00 2001 From: phintuka Date: Tue, 30 Jun 2009 13:05:57 +0000 Subject: Replaced m_Running with cThread::Running() --- tools/udp_pes_scheduler.c | 14 ++++++-------- tools/udp_pes_scheduler.h | 3 +-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tools/udp_pes_scheduler.c b/tools/udp_pes_scheduler.c index c2f19182..7c9ca73b 100644 --- a/tools/udp_pes_scheduler.c +++ b/tools/udp_pes_scheduler.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: udp_pes_scheduler.c,v 1.39 2009-06-01 14:33:11 phintuka Exp $ + * $Id: udp_pes_scheduler.c,v 1.40 2009-06-30 13:05:57 phintuka Exp $ * */ @@ -109,8 +109,6 @@ cUdpScheduler::cUdpScheduler() // Thread - m_Running = 1; - Start(); } @@ -118,7 +116,7 @@ cUdpScheduler::~cUdpScheduler() { m_Lock.Lock(); - m_Running = 0; + Cancel(-1); m_Cond.Broadcast(); m_Lock.Unlock(); @@ -332,7 +330,7 @@ int cUdpScheduler::Poll(int TimeoutMs, bool Master) WaitEnd += (uint64_t)TimeoutMs; while(cTimeMs::Now() < WaitEnd && - m_Running && + Running() && m_QueuePending >= limit) m_Cond.TimedWait(m_Lock, 5); } @@ -353,7 +351,7 @@ bool cUdpScheduler::Flush(int TimeoutMs) WaitEnd += (uint64_t)TimeoutMs; while(cTimeMs::Now() < WaitEnd && - m_Running && + Running() && m_QueuePending > 0) m_Cond.TimedWait(m_Lock, 5); } @@ -693,7 +691,7 @@ void cUdpScheduler::Action(void) m_Lock.Lock(); - while(m_Running) { + while (Running()) { if(m_Handles[0] < 0) { m_Cond.TimedWait(m_Lock, 5000); @@ -718,7 +716,7 @@ void cUdpScheduler::Action(void) m_BackLog->MakeFrame(0, padding, 8); m_QueuePending++; } - continue; // to check m_Running + continue; // to check Running() } // Take next frame from queue diff --git a/tools/udp_pes_scheduler.h b/tools/udp_pes_scheduler.h index 7638f1e3..d53cc562 100644 --- a/tools/udp_pes_scheduler.h +++ b/tools/udp_pes_scheduler.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: udp_pes_scheduler.h,v 1.14 2009-03-24 19:00:27 phintuka Exp $ + * $Id: udp_pes_scheduler.h,v 1.15 2009-06-30 13:05:57 phintuka Exp $ * */ @@ -95,7 +95,6 @@ class cUdpScheduler : public cThread int calc_elapsed_vtime(int64_t pts, bool Audio); void Schedule(const uchar *Data, int Length); - bool m_Running; virtual void Action(void); void Send_RTCP(void); -- cgit v1.2.3