Jaroslav Kysela [Wed, 12 Mar 2014 16:05:59 +0000 (17:05 +0100)]
The sbuf allocation cleanups
This is an attempt to fix the nonoptimal memory allocations. The old
code tries to allocate new chunks based on maximum packet value, but
the streams contain mostly short chunks. Also, in some cases, we know
the fixed sbuf size, so use it.
Jaroslav Kysela [Wed, 5 Mar 2014 16:31:19 +0000 (17:31 +0100)]
PID lookup, streaming pad filter and sbuf alloc optimizations
There is high probability (because of the "nature" of TS streams) that
next PID will match previous one. This patch tries to do simple "caching"
of last PID to speedup PID lookups.
The streaming pad filter is handled faster way now.
Also, sbuf allocations routines are optimized (better sb_size prediction and
allocation routine is called only on demand - not all time).
Natanael Copa [Tue, 4 Mar 2014 15:22:45 +0000 (15:22 +0000)]
build: typecast NGREG to int
Fixes the following error with musl libc:
src/trap.c: In function 'traphandler':
src/trap.c:178:3: error: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Werror=format=]
snprintf(tmpbuf, sizeof(tmpbuf), "Register dump [%d]: ", NGREG);
^
Natanael Copa [Tue, 4 Mar 2014 12:32:34 +0000 (12:32 +0000)]
build: detect wordsize in a portable way
There are no standard that says that __WORDSIZE should be defined or
in what include file. So in case its not defined we fallback to a
POSIX compliant way to determine wordsize.
Natanael Copa [Tue, 4 Mar 2014 11:56:33 +0000 (11:56 +0000)]
build: check for gcc version independent of platform
Use the gcc specific __GNUC__ and __GNUC__ minor to determine gcc version
rather than using the GNU libc specific __GNUC_PREREQ.
This fixes the following compile error with musl libc:
src/descrambler/capmt.c:79:18: error: missing binary operator before token "("
#if __GNUC_PREREQ(4, 3)
^
Natanael Copa [Tue, 4 Mar 2014 11:49:34 +0000 (11:49 +0000)]
build: check for qsort_r independent of platform
Rather than check for specific glibc version on PLATFORM_LINUX, check
the existance of qsort_r.
This fixes the following compile error with musl libc:
CC src/main.o
In file included from src/main.c:39:0:
src/tvheadend.h:608:20: error: missing binary operator before token "("
#if !__GLIBC_PREREQ(2,8)
^
Jaroslav Kysela [Mon, 17 Feb 2014 10:43:01 +0000 (11:43 +0100)]
Graceful exit
It's necessary to do serious checks for the memory leaks using
tools like valgrind. This patch tries to implement a graceful
exit for all tvheadend components and free allocated memory.
src/descrambler/capmt.c:485: warning: comparison is always false due to limited range of data type
src/descrambler/capmt.c:487: warning: comparison is always false due to limited range of data type
src/descrambler/capmt.c:538: warning: comparison is always false due to limited range of data type
src/descrambler/capmt.c:549: warning: comparison is always false due to limited range of data type
Adam Sutton [Sat, 11 Jan 2014 21:03:01 +0000 (21:03 +0000)]
linuxdvb: some simplications to EN50494 support
I've removed some of the bounds checking, not a bad thing to have it, but
in general we work on the principle that if the user really is trying hard
enough to pass broken values, then so be it!
Also correct some spelling mistakes and change UI refs to "Unicable" rather
than the standard "EN50494".
Adam Sutton [Sat, 11 Jan 2014 00:21:08 +0000 (00:21 +0000)]
linuxdvb: minor tweak to adapter UUID generation
This overcomes issues with multi-frontend tuners that change the
tuner name based on the selected frontend. We simply force the selection
of the first available frontend, which should keep things constant.
build: Add missing include for Dl_info on FreeBSD which is only used
when execinfo is enabled.
src/trap.c:144: error: 'Dl_info' undeclared (first use in this function)
src/trap.c:144: error: expected ';' before 'dli'
cc1: warnings being treated as errors
src/trap.c:187: warning: implicit declaration of function 'dladdr'
src/trap.c:187: error: 'dli' undeclared (first use in this function)