Optimized receiver thread termination.

This commit is contained in:
Rolf Ahrenberg 2008-09-10 17:37:28 +03:00
parent 0b19b7b31d
commit 1570cf80f8
3 changed files with 39 additions and 36 deletions

View File

@ -302,3 +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.

View File

@ -58,6 +58,7 @@ cFemonReceiver::cFemonReceiver(tChannelID ChannelID, int Ca, int Vpid, int Apid[
cFemonReceiver::~cFemonReceiver(void)
{
Dprintf("%s()\n", __PRETTY_FUNCTION__);
m_Sleep.Signal();
if (Running())
Cancel(3);
Detach();
@ -362,6 +363,6 @@ void cFemonReceiver::Action(void)
m_AudioPacketCount = 0;
m_AC3Bitrate = (10.0 * 8.0 * 184.0 * m_AC3PacketCount) / femonConfig.calcinterval;
m_AC3PacketCount = 0;
cCondWait::SleepMs(100 * femonConfig.calcinterval - t.Elapsed());
m_Sleep.Wait(max((int)(100 * femonConfig.calcinterval - t.Elapsed()), 3));
}
}

View File

@ -47,7 +47,7 @@ enum eDolbySurroundMode {
DSM_RESERVED = 3,
};
enum eReveiverCodes {
enum eReceiverCodes {
FR_RESERVED = -1,
FR_FREE = -2,
FR_NOTVALID = -3
@ -55,6 +55,7 @@ enum eReveiverCodes {
class cFemonReceiver : public cReceiver, public cThread {
private:
cCondWait m_Sleep;
int m_VideoPid;
int m_AudioPid;
int m_AC3Pid;