diff options
| author | phintuka <phintuka> | 2009-08-18 12:43:37 +0000 |
|---|---|---|
| committer | phintuka <phintuka> | 2009-08-18 12:43:37 +0000 |
| commit | 7c0d80a5f97b76156e6b36c132e0adc3ffe131c9 (patch) | |
| tree | 3274072c3e0c61b4c679fa35b1a3c26583aa32b2 | |
| parent | 1c0fbc15d923b265c33f9c95374efb24e33d3148 (diff) | |
| download | xineliboutput-7c0d80a5f97b76156e6b36c132e0adc3ffe131c9.tar.gz xineliboutput-7c0d80a5f97b76156e6b36c132e0adc3ffe131c9.tar.bz2 | |
Use cThread::Running() and cThread::Cancel()
| -rw-r--r-- | frontend.c | 51 | ||||
| -rw-r--r-- | frontend.h | 11 |
2 files changed, 9 insertions, 53 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.70 2009-08-01 19:50:36 phintuka Exp $ + * $Id: frontend.c,v 1.71 2009-08-18 12:43:37 phintuka Exp $ * */ @@ -188,7 +188,7 @@ void cXinelibThread::InfoHandler(const char *info) map = end+1; } } - + else if(!strncmp(info, "DVDBUTTONS ", 11)) { map += 11; while(*map == ' ') map++; @@ -217,7 +217,6 @@ cXinelibThread::cXinelibThread(const char *Description) : cThread(Description) TRACEF("cXinelibThread::cXinelibThread"); m_Volume = 255; - m_bStopThread = false; m_bReady = false; m_bIsFinished = false; m_bNoVideo = true; @@ -230,54 +229,20 @@ cXinelibThread::cXinelibThread(const char *Description) : cThread(Description) m_StatusMonitor = NULL; } -cXinelibThread::~cXinelibThread() +cXinelibThread::~cXinelibThread() { TRACEF("cXinelibThread::~cXinelibThread"); - m_bStopThread = true; - if(Active()) - Cancel(); - if(m_StatusMonitor) - delete m_StatusMonitor; + Cancel(3); + + if (m_StatusMonitor) + DELETENULL(m_StatusMonitor); } // // Thread control // -void cXinelibThread::Start(void) -{ - TRACEF("cXinelibThread::Start"); - - cThread::Start(); -} - -void cXinelibThread::Stop(void) -{ - TRACEF("cXinelibThread::Stop"); - - SetStopSignal(); - - //if(Active()) - Cancel(5); -} - -void cXinelibThread::SetStopSignal(void) -{ - TRACEF("cXinelibThread::SetStopSignal"); - - LOCK_THREAD; - m_bStopThread = true; -} - -bool cXinelibThread::GetStopSignal(void) -{ - TRACEF("cXinelibThread::GetStopSignal"); - - LOCK_THREAD; - return m_bStopThread; -} - bool cXinelibThread::IsReady(void) { LOCK_THREAD; @@ -772,7 +737,7 @@ bool cXinelibThread::PlayFile(const char *FileName, int Position, } } - return (!GetStopSignal()) && (result==0); + return Running() && !result; } @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend.h,v 1.29 2009-08-01 19:50:36 phintuka Exp $ + * $Id: frontend.h,v 1.30 2009-08-18 12:43:37 phintuka Exp $ * */ @@ -33,17 +33,9 @@ class cXinelibThread : public cThread, public cListObject // public: - virtual void Start(void); - virtual void Stop(void); bool IsReady(void); bool IsFinished(void); - protected: - void SetStopSignal(void); - bool GetStopSignal(void); - - virtual void Action(void) = 0; - // // Playback control // @@ -137,7 +129,6 @@ class cXinelibThread : public cThread, public cListObject // protected: - bool m_bStopThread; bool m_bReady; bool m_bIsFinished; bool m_bNoVideo; |
