From f40d9b699b16eddd00c5f3109227b65bf518e132 Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Wed, 17 Sep 2008 18:51:38 +0300 Subject: [PATCH] Optimized OSD thread termination. --- HISTORY | 2 +- femonosd.c | 3 ++- femonosd.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index 55d0562..0c76235 100644 --- a/HISTORY +++ b/HISTORY @@ -302,4 +302,4 @@ VDR Plugin 'femon' Revision History 2008-xx-xx: Version 1.6.2 - Converted HISTORY and fi_FI.po to UTF-8. -- Optimized receiver thread termination. +- Optimized receiver and OSD thread termination. diff --git a/femonosd.c b/femonosd.c index 54e4c87..57a5e58 100644 --- a/femonosd.c +++ b/femonosd.c @@ -128,6 +128,7 @@ cFemonOsd::cFemonOsd() cFemonOsd::~cFemonOsd(void) { Dprintf("%s()\n", __PRETTY_FUNCTION__); + m_Sleep.Signal(); if (Running()) Cancel(3); if (m_SvdrpConnection.handle >= 0) { @@ -557,7 +558,7 @@ void cFemonOsd::Action(void) DrawInfoWindow(); DrawStatusWindow(); } - cCondWait::SleepMs(100 * femonConfig.updateinterval - t.Elapsed()); + m_Sleep.Wait(max((int)(100 * femonConfig.updateinterval - t.Elapsed()), 3)); } } diff --git a/femonosd.h b/femonosd.h index 13dbbab..2f6dce0 100644 --- a/femonosd.h +++ b/femonosd.h @@ -46,6 +46,7 @@ private: int m_DisplayMode; const cFont *m_Font; cTimeMs m_InputTime; + cCondWait m_Sleep; cMutex* m_Mutex; static cBitmap bmStereo, bmMonoLeft, bmMonoRight, bmDD, bmDD20, bmDD51; static cBitmap bmNumbers[MAX_BMNUMBERS];