1
0
mirror of https://github.com/rofafor/vdr-plugin-satip.git synced 2023-10-10 13:37:42 +02:00

Bugfix: Reading from sockets.

In cSatipRtp::Process() und cSatipRtcp::Process() we need to read until no more data is
available, not just once.

The original patch is polished and tweaked by Rolf Ahrenberg.
This commit is contained in:
nafets227 2014-11-27 21:03:56 +01:00 committed by Rolf Ahrenberg
parent c966d28d13
commit fde3198997
3 changed files with 16 additions and 12 deletions

0
device.c Executable file → Normal file
View File

6
rtcp.c
View File

@ -81,11 +81,13 @@ void cSatipRtcp::Process(void)
{ {
//debug("cSatipRtcp::%s() [device %d]", __FUNCTION__, tunerM.GetId()); //debug("cSatipRtcp::%s() [device %d]", __FUNCTION__, tunerM.GetId());
if (bufferM) { if (bufferM) {
int length = Read(bufferM, bufferLenM); int length;
if (length > 0) { while ((length = Read(bufferM, bufferLenM)) > 0) {
int offset = GetApplicationOffset(&length); int offset = GetApplicationOffset(&length);
if (offset >= 0) if (offset >= 0)
tunerM.ProcessApplicationData(bufferM + offset, length); tunerM.ProcessApplicationData(bufferM + offset, length);
} }
if (errno != EAGAIN && errno != EWOULDBLOCK)
error("Error %d reading from RTCP socket [device %d]", errno, tunerM.GetId());
} }
} }

6
rtp.c
View File

@ -111,11 +111,13 @@ void cSatipRtp::Process(void)
{ {
//debug("cSatipRtp::%s() [device %d]", __FUNCTION__, tunerM.GetId()); //debug("cSatipRtp::%s() [device %d]", __FUNCTION__, tunerM.GetId());
if (bufferM) { if (bufferM) {
int length = Read(bufferM, bufferLenM); int length;
if (length > 0) { while ((length = Read(bufferM, bufferLenM)) > 0) {
int headerlen = GetHeaderLenght(length); int headerlen = GetHeaderLenght(length);
if ((headerlen >= 0) && (headerlen < length)) if ((headerlen >= 0) && (headerlen < length))
tunerM.ProcessVideoData(bufferM + headerlen, length - headerlen); tunerM.ProcessVideoData(bufferM + headerlen, length - headerlen);
} }
if (errno != EAGAIN && errno != EWOULDBLOCK)
error("Error %d reading from RTP socket [device %d]", errno, tunerM.GetId());
} }
} }