diff --git a/protocolrtp.c b/protocolrtp.c index 3bdaa4c..c93f4b8 100644 --- a/protocolrtp.c +++ b/protocolrtp.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: protocolrtp.c,v 1.1 2007/09/26 19:49:35 rahrenbe Exp $ + * $Id: protocolrtp.c,v 1.2 2007/09/26 22:07:45 rahrenbe Exp $ */ #include @@ -178,12 +178,11 @@ int cIptvProtocolRtp::Read(unsigned char* *BufferAddr) MSG_DONTWAIT, (struct sockaddr *)&sockAddr, &addrlen); if (len > 0) { // http://www.networksorcery.com/enp/rfc/rfc2250.txt - const unsigned int headerlen = 4 * sizeof(uint32_t); - uint8_t *header = readBuffer + sizeof(uint8_t); + const int headerlen = 4 * sizeof(uint32_t); // Check if payload type is MPEG2 TS and payload contains multiple of TS packet data - if (((*header & 0x7F) == 33) && (((len - headerlen) % TS_SIZE) == 0)) { + if (((readBuffer[1] & 0x7F) == 33) && (((len - headerlen) % TS_SIZE) == 0)) { // Set argument point to payload in read buffer - *BufferAddr = readBuffer + headerlen; + *BufferAddr = &readBuffer[headerlen]; return (len - headerlen); } } diff --git a/sectionfilter.c b/sectionfilter.c index 2d0ac2c..3f2267e 100644 --- a/sectionfilter.c +++ b/sectionfilter.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: sectionfilter.c,v 1.4 2007/09/24 21:25:54 rahrenbe Exp $ + * $Id: sectionfilter.c,v 1.5 2007/09/26 22:07:45 rahrenbe Exp $ */ #include "sectionfilter.h" @@ -49,13 +49,13 @@ cIptvSectionFilter::cIptvSectionFilter(int Index, int devInd, struct stat sb; stat(pipeName, &sb); if (S_ISFIFO(sb.st_mode)) - unlink(pipeName); + unlink(pipeName); int err = mknod(pipeName, 0644 | S_IFIFO, 0); if (err < 0) { - char tmp[64]; - error("ERROR: mknod(): %s", strerror_r(errno, tmp, sizeof(tmp))); - return; - } + char tmp[64]; + error("ERROR: mknod(): %s", strerror_r(errno, tmp, sizeof(tmp))); + return; + } // Create descriptors fifoDescriptor = open(pipeName, O_RDWR | O_NONBLOCK);