mirror of
https://projects.vdr-developer.org/git/vdr-plugin-streamdev.git
synced 2023-10-10 19:16:51 +02:00
writer must not spend too much time waiting in select() without checking
if the thread has been cancelled. Delayed the streamdev main thread for up to 3 seconds. As the command timeou of VTP connections is 1.5 seconds, one hanging connection could have caused VTP connections to die.
This commit is contained in:
parent
17bb6390f9
commit
19e8cf2a28
2
HISTORY
2
HISTORY
@ -1,6 +1,8 @@
|
|||||||
VDR Plugin 'streamdev' Revision History
|
VDR Plugin 'streamdev' Revision History
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
|
- writer must not spend too much time waiting in select() without checking
|
||||||
|
if the thread has been cancelled
|
||||||
- added Spanish translation (thanks to Javier Bradineras)
|
- added Spanish translation (thanks to Javier Bradineras)
|
||||||
- live TV must be switched in VDR main thread
|
- live TV must be switched in VDR main thread
|
||||||
- dropped compatibility with VDR < 1.5.16
|
- dropped compatibility with VDR < 1.5.16
|
||||||
|
@ -45,6 +45,7 @@ void cStreamdevWriter::Action(void)
|
|||||||
int max = 0;
|
int max = 0;
|
||||||
uchar *block = NULL;
|
uchar *block = NULL;
|
||||||
int count, offset = 0;
|
int count, offset = 0;
|
||||||
|
int timeout = 0;
|
||||||
|
|
||||||
#if APIVERSNUM >= 10705
|
#if APIVERSNUM >= 10705
|
||||||
SetPriority(-3);
|
SetPriority(-3);
|
||||||
@ -58,10 +59,13 @@ void cStreamdevWriter::Action(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (block != NULL) {
|
if (block != NULL) {
|
||||||
if (sel.Select(15000) == -1) {
|
if (sel.Select(600) == -1) {
|
||||||
|
if (errno == ETIMEDOUT && timeout++ < 20)
|
||||||
|
continue; // still Running()?
|
||||||
esyslog("ERROR: streamdev-server: couldn't send data: %m");
|
esyslog("ERROR: streamdev-server: couldn't send data: %m");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
timeout = 0;
|
||||||
|
|
||||||
if (sel.CanWrite(*m_Socket)) {
|
if (sel.CanWrite(*m_Socket)) {
|
||||||
int written;
|
int written;
|
||||||
|
Loading…
Reference in New Issue
Block a user