mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 15:02:58 +02:00
libtriple: add workaround for 'odd filter length' problem in cDemux
This commit is contained in:
@@ -212,13 +212,17 @@ bool cDemux::sectionFilter(unsigned short pid, const unsigned char * const filte
|
|||||||
const unsigned char * const negmask)
|
const unsigned char * const negmask)
|
||||||
{
|
{
|
||||||
struct demux_filter_para flt;
|
struct demux_filter_para flt;
|
||||||
|
int length;
|
||||||
memset(&flt, 0, sizeof(flt));
|
memset(&flt, 0, sizeof(flt));
|
||||||
|
|
||||||
if (len > FILTER_LENGTH - 2)
|
if (len > FILTER_LENGTH - 2)
|
||||||
fprintf(stderr, "cDemux::sectionFilter #%d: len too long: %d, FILTER_LENGTH: %d\n", num, len, FILTER_LENGTH);
|
fprintf(stderr, "cDemux::sectionFilter #%d: len too long: %d, FILTER_LENGTH: %d\n", num, len, FILTER_LENGTH);
|
||||||
|
|
||||||
|
length = (len + 2 + 1) & 0xfe; /* reportedly, the TD drivers don't handle odd filter */
|
||||||
|
if (length > FILTER_LENGTH) /* lengths well. So make sure the length is a multiple */
|
||||||
|
length = FILTER_LENGTH; /* of 2. The unused mask is zeroed anyway. */
|
||||||
flt.pid = pid;
|
flt.pid = pid;
|
||||||
flt.filter_length = len + 2 * (len > 1); /* only add the two bytes if required */
|
flt.filter_length = length;
|
||||||
flt.filter[0] = filter[0];
|
flt.filter[0] = filter[0];
|
||||||
flt.mask[0] = mask[0];
|
flt.mask[0] = mask[0];
|
||||||
flt.timeout = timeout;
|
flt.timeout = timeout;
|
||||||
|
Reference in New Issue
Block a user