mirror of
https://projects.vdr-developer.org/git/vdr-plugin-streamdev.git
synced 2023-10-10 19:16:51 +02:00
make sure TimedWrite(...) doesn't return failure after a slow but successful
write operation (refs #2045)
This commit is contained in:
parent
b33d2631df
commit
3e06c59196
@ -240,6 +240,7 @@ Martin1234
|
|||||||
Toerless Eckert
|
Toerless Eckert
|
||||||
for converting suspend.dat into proper PES format
|
for converting suspend.dat into proper PES format
|
||||||
for investigating and fixing problems caused by filter streaming
|
for investigating and fixing problems caused by filter streaming
|
||||||
|
for fixing TimedWrite() so it doesn't fail after a slow but successful write
|
||||||
|
|
||||||
Tomasz Maciej Nowak
|
Tomasz Maciej Nowak
|
||||||
for providing Polish language texts
|
for providing Polish language texts
|
||||||
|
2
HISTORY
2
HISTORY
@ -1,6 +1,8 @@
|
|||||||
VDR Plugin 'streamdev' Revision History
|
VDR Plugin 'streamdev' Revision History
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
|
- make sure TimedWrite(...) doesn't return failure after a slow but successful
|
||||||
|
write operation (thanks to Toerless Eckert)
|
||||||
- fixed problems related to VTP filter streaming like ringbuffer overflows,
|
- fixed problems related to VTP filter streaming like ringbuffer overflows,
|
||||||
stuttering or aborting video stream (thanks to Toerless Eckert)
|
stuttering or aborting video stream (thanks to Toerless Eckert)
|
||||||
- added Polish translation (thanks to Tomasz Maciej Nowak)
|
- added Polish translation (thanks to Tomasz Maciej Nowak)
|
||||||
|
@ -57,15 +57,20 @@ ssize_t cTBSource::Write(const void *Buffer, size_t Length) {
|
|||||||
bool cTBSource::TimedWrite(const void *Buffer, size_t Length, uint TimeoutMs) {
|
bool cTBSource::TimedWrite(const void *Buffer, size_t Length, uint TimeoutMs) {
|
||||||
cTBSelect sel;
|
cTBSelect sel;
|
||||||
int ms, offs;
|
int ms, offs;
|
||||||
|
|
||||||
cTimeMs starttime;
|
cTimeMs starttime;
|
||||||
ms = TimeoutMs;
|
|
||||||
offs = 0;
|
offs = 0;
|
||||||
sel.Clear();
|
sel.Clear();
|
||||||
sel.Add(m_Filed, true);
|
sel.Add(m_Filed, true);
|
||||||
while (Length > 0) {
|
while (Length > 0) {
|
||||||
int b;
|
int b;
|
||||||
|
|
||||||
|
ms = TimeoutMs - starttime.Elapsed();
|
||||||
|
if (ms <= 0) {
|
||||||
|
errno = ETIMEDOUT;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (sel.Select(ms) == -1)
|
if (sel.Select(ms) == -1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -76,11 +81,6 @@ bool cTBSource::TimedWrite(const void *Buffer, size_t Length, uint TimeoutMs) {
|
|||||||
Length -= b;
|
Length -= b;
|
||||||
}
|
}
|
||||||
|
|
||||||
ms = TimeoutMs - starttime.Elapsed();
|
|
||||||
if (ms <= 0) {
|
|
||||||
errno = ETIMEDOUT;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user