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:
parent
c966d28d13
commit
fde3198997
14
rtcp.c
14
rtcp.c
@ -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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
14
rtp.c
14
rtp.c
@ -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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user