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.
|
- Tweaked pid scanner parameters for HD broadcasts.
|
||||||
- Fixed opening of fifo tap.
|
- Fixed opening of fifo tap.
|
||||||
- Updated iptvstream.sh script to support optional video resolution settings.
|
- Updated iptvstream.sh script to support optional video resolution settings.
|
||||||
|
- Optimized streamer thread termination.
|
||||||
|
@ -45,11 +45,11 @@ void cIptvStreamer::Action(void)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mutex->Unlock();
|
mutex->Unlock();
|
||||||
cCondWait::SleepMs(100); // to reduce cpu load
|
sleep.Wait(100); // to reduce cpu load
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
cCondWait::SleepMs(100); // and avoid busy loop
|
sleep.Wait(100); // and avoid busy loop
|
||||||
}
|
}
|
||||||
debug("cIptvStreamer::Action(): Exiting\n");
|
debug("cIptvStreamer::Action(): Exiting\n");
|
||||||
}
|
}
|
||||||
@ -69,6 +69,7 @@ bool cIptvStreamer::Close(void)
|
|||||||
{
|
{
|
||||||
debug("cIptvStreamer::Close()\n");
|
debug("cIptvStreamer::Close()\n");
|
||||||
// Stop thread
|
// Stop thread
|
||||||
|
sleep.Signal();
|
||||||
if (Running())
|
if (Running())
|
||||||
Cancel(3);
|
Cancel(3);
|
||||||
// Close the protocol. A mutex should be taken here to avoid a race condition
|
// 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:
|
private:
|
||||||
cRingBufferLinear* ringBuffer;
|
cRingBufferLinear* ringBuffer;
|
||||||
cMutex* mutex;
|
cMutex* mutex;
|
||||||
|
cCondWait sleep;
|
||||||
unsigned char* readBuffer;
|
unsigned char* readBuffer;
|
||||||
unsigned int readBufferLen;
|
unsigned int readBufferLen;
|
||||||
cIptvProtocolIf* protocol;
|
cIptvProtocolIf* protocol;
|
||||||
|
Loading…
Reference in New Issue
Block a user