mirror of
https://github.com/rofafor/vdr-plugin-iptv.git
synced 2023-10-10 13:37:03 +02:00
Optimized streamer thread termination.
This commit is contained in:
parent
4e8e26a4b3
commit
c5a7598544
1
HISTORY
1
HISTORY
@ -70,3 +70,4 @@ VDR Plugin 'iptv' Revision History
|
||||
- Tweaked pid scanner parameters for HD broadcasts.
|
||||
- Fixed opening of fifo tap.
|
||||
- Updated iptvstream.sh script to support optional video resolution settings.
|
||||
- Optimized streamer thread termination.
|
||||
|
@ -45,11 +45,11 @@ void cIptvStreamer::Action(void)
|
||||
}
|
||||
else {
|
||||
mutex->Unlock();
|
||||
cCondWait::SleepMs(100); // to reduce cpu load
|
||||
sleep.Wait(100); // to reduce cpu load
|
||||
}
|
||||
}
|
||||
else
|
||||
cCondWait::SleepMs(100); // and avoid busy loop
|
||||
sleep.Wait(100); // and avoid busy loop
|
||||
}
|
||||
debug("cIptvStreamer::Action(): Exiting\n");
|
||||
}
|
||||
@ -69,6 +69,7 @@ bool cIptvStreamer::Close(void)
|
||||
{
|
||||
debug("cIptvStreamer::Close()\n");
|
||||
// Stop thread
|
||||
sleep.Signal();
|
||||
if (Running())
|
||||
Cancel(3);
|
||||
// Close the protocol. A mutex should be taken here to avoid a race condition
|
||||
|
@ -20,6 +20,7 @@ class cIptvStreamer : public cThread, public cIptvStreamerStatistics {
|
||||
private:
|
||||
cRingBufferLinear* ringBuffer;
|
||||
cMutex* mutex;
|
||||
cCondWait sleep;
|
||||
unsigned char* readBuffer;
|
||||
unsigned int readBufferLen;
|
||||
cIptvProtocolIf* protocol;
|
||||
|
Loading…
Reference in New Issue
Block a user