From 713f9e652ad9469b074f3660ea533956d2b78b9d Mon Sep 17 00:00:00 2001 From: Rolf Ahrenberg Date: Mon, 15 Aug 2005 04:20:00 +0300 Subject: [PATCH] Threads updated for vdr-1.3.29. --- HISTORY | 4 ++++ femon.c | 2 +- femon.h | 2 +- femonosd.c | 7 ++----- femonosd.h | 1 - femonreceiver.c | 18 +++++------------- femonreceiver.h | 1 - 7 files changed, 13 insertions(+), 22 deletions(-) diff --git a/HISTORY b/HISTORY index a6b23ca..d130527 100644 --- a/HISTORY +++ b/HISTORY @@ -167,3 +167,7 @@ VDR Plugin 'femon' Revision History - Fixed AC3-info flickering (Thanks to Pasi Juppo for reporting this one). - Added "Analog" type CA system. - Plugin is now stripped by default. + +2005-08-15: Version 0.9.2 + +- Threads updated for vdr-1.3.29. diff --git a/femon.c b/femon.c index 069740f..33b1362 100644 --- a/femon.c +++ b/femon.c @@ -12,7 +12,7 @@ #include "femonosd.h" #include "femon.h" -#if VDRVERSNUM && VDRVERSNUM < 10321 +#if VDRVERSNUM && VDRVERSNUM < 10329 #error "You don't exist! Go away!" #endif diff --git a/femon.h b/femon.h index b43070d..e8f8c74 100644 --- a/femon.h +++ b/femon.h @@ -11,7 +11,7 @@ #include -static const char *VERSION = "0.9.1"; +static const char *VERSION = "0.9.2"; static const char *DESCRIPTION = "DVB Signal Information Monitor (OSD)"; static const char *MAINMENUENTRY = "Signal Information"; diff --git a/femonosd.c b/femonosd.c index 11007f3..462594d 100644 --- a/femonosd.c +++ b/femonosd.c @@ -87,7 +87,6 @@ cFemonOsd::cFemonOsd(void) m_Osd = NULL; m_Receiver = NULL; m_Frontend = -1; - m_Active = false; m_Number = 0; m_OldNumber = 0; m_Signal = 0; @@ -110,8 +109,7 @@ cFemonOsd::cFemonOsd(void) cFemonOsd::~cFemonOsd(void) { Dprintf("%s()\n", __PRETTY_FUNCTION__); - if (m_Active) { - m_Active = false; + if (Running()) { Cancel(3); } if (m_Receiver) @@ -847,8 +845,7 @@ void cFemonOsd::Action(void) { Dprintf("%s()\n", __PRETTY_FUNCTION__); cTimeMs t; - m_Active = true; - while (m_Active) { + while (Running()) { t.Set(0); if (m_Frontend != -1) { CHECK(ioctl(m_Frontend, FE_READ_STATUS, &m_FrontendStatus)); diff --git a/femonosd.h b/femonosd.h index a77bc1d..64fd5c4 100644 --- a/femonosd.h +++ b/femonosd.h @@ -21,7 +21,6 @@ class cFemonOsd : public cOsdObject, public cThread, public cStatus { private: - bool m_Active; cOsd *m_Osd; cFemonReceiver *m_Receiver; int m_Frontend; diff --git a/femonreceiver.c b/femonreceiver.c index 93f9526..a49c017 100644 --- a/femonreceiver.c +++ b/femonreceiver.c @@ -21,7 +21,6 @@ cFemonReceiver::cFemonReceiver(int Ca, int Vpid, int Apid[], int Dpid[]) :cReceiver(Ca, -1, Vpid, Apid, Dpid, NULL), cThread("femon receiver") { Dprintf("%s()\n", __PRETTY_FUNCTION__); - m_Active = false; m_VideoPid = Vpid; m_AudioPid = Apid[0]; m_AC3Pid = Dpid[0]; @@ -60,10 +59,8 @@ cFemonReceiver::~cFemonReceiver(void) { Dprintf("%s()\n", __PRETTY_FUNCTION__); Detach(); - if (m_Active) { - m_Active = false; + if (Running()) Cancel(); - } } /* The following function originates from libdvbmpeg: */ @@ -253,14 +250,10 @@ void cFemonReceiver::GetAC3Info(uint8_t *mbuf, int count) void cFemonReceiver::Activate(bool On) { Dprintf("%s(%d)\n", __PRETTY_FUNCTION__, On); - if (On) { - if (!m_Active) - Start(); - } - else if (m_Active) { - m_Active = false; + if (On) + Start(); + else Cancel(); - } } void cFemonReceiver::Receive(uchar *Data, int Length) @@ -309,8 +302,7 @@ void cFemonReceiver::Action(void) { Dprintf("%s()\n", __PRETTY_FUNCTION__); cTimeMs t; - m_Active = true; - while (m_Active) { + while (Running()) { t.Set(0); // TS packet 188 bytes - 4 byte header; MPEG standard defines 1Mbit = 1000000bit m_VideoBitrate = (8.0 * 184.0 * m_VideoPacketCount) / (femonConfig.calcinterval * 100000.0); diff --git a/femonreceiver.h b/femonreceiver.h index 4659584..78d6ab7 100644 --- a/femonreceiver.h +++ b/femonreceiver.h @@ -53,7 +53,6 @@ enum eDolbySurroundMode { class cFemonReceiver : public cReceiver, public cThread { private: - bool m_Active; int m_VideoPid; int m_AudioPid; int m_AC3Pid;