diff options
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_demux.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_demux.c b/linux/drivers/media/dvb/dvb-core/dvb_demux.c index 26c793d13..1aab8b0ab 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_demux.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_demux.c @@ -327,7 +327,7 @@ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed, const static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, const u8 *buf) { u8 p, count; - int ccok; + int ccok, dc_i = 0; u8 cc; count = payload(buf); @@ -335,13 +335,19 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, const u8 if (count == 0) /* count == 0 if no payload or out of range */ return -1; - p = 188-count; /* payload start */ - + p = 188 - count; /* payload start */ + cc = buf[3] & 0x0f; - ccok = ((feed->cc+1) & 0x0f) == cc ? 1 : 0; + ccok = ((feed->cc + 1) & 0x0f) == cc; feed->cc = cc; - if(ccok == 0) - { + + if (buf[3] & 0x20) { + /* adaption field present, check for discontinuity_indicator */ + if ((buf[4] > 0) && (buf[5] & 0x80)) + dc_i = 1; + } + + if (!ccok || dc_i) { #ifdef DVB_DEMUX_SECTION_LOSS_LOG printk("dvb_demux.c discontinuity detected %d bytes lost\n", count); /* those bytes under sume circumstances will again be reported @@ -356,11 +362,9 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, const u8 return 0; } - if(buf[1] & 0x40) - { + if (buf[1] & 0x40) { // PUSI=1 (is set), section boundary is here - if(count > 1 && buf[p] < count) - { + if (count > 1 && buf[p] < count) { const u8 *before = buf+p+1; u8 before_len = buf[p]; const u8 *after = before+before_len; @@ -374,12 +378,10 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, const u8 } #ifdef DVB_DEMUX_SECTION_LOSS_LOG else - if(count > 0) + if (count > 0) printk("dvb_demux.c PUSI=1 but %d bytes lost\n", count); #endif - } - else - { + } else { // PUSI=0 (is not set), no section boundary const u8 *entire = buf+p; u8 entire_len = count; |