Project

General

Profile

RE: Question on the TBS6982 » continuity-counter-fix.patch

Anonymous, 2014-01-05 12:15

View differences:

linux/drivers/media/dvb/dvb-core/dvb_demux.c 2013-12-17 19:43:34.226540530 +0000
426 426
		};
427 427
	};
428 428

  
429
	if (demux->cnt_storage && dvb_demux_tscheck) {
430
		/* check pkt counter */
431
		if (pid < MAX_PID) {
432
			if (buf[1] & 0x80)
433
				dprintk_tscheck("TEI detected. "
434
						"PID=0x%x data1=0x%x\n",
435
						pid, buf[1]);
429
        if (buf[1] & 0x80) {
430
                dprintk_tscheck("TEI detected. "
431
                                "PID=0x%x data1=0x%x\n",
432
                                pid, buf[1]);
433
                /* data in this packet cant be trusted - drop it unless
434
                 * module option dvb_demux_feed_err_pkts is set */
435
                /*if (!dvb_demux_feed_err_pkts)
436
                        return;*/
437
        } else /* if TEI bit is set, pid may be wrong- skip pkt counter */
438
                if (demux->cnt_storage && dvb_demux_tscheck) {
439
                        /* check pkt counter */
440
                        if (pid < MAX_PID) {
441
                                if (buf[3] & 0x10)
442
                                        demux->cnt_storage[pid] =
443
                                                (demux->cnt_storage[pid] + 1) & 0xf;
436 444

  
437
			if ((buf[3] & 0xf) != demux->cnt_storage[pid])
438
				dprintk_tscheck("TS packet counter mismatch. "
439
						"PID=0x%x expected 0x%x "
440
						"got 0x%x\n",
441
						pid, demux->cnt_storage[pid],
442
						buf[3] & 0xf);
443

  
444
			demux->cnt_storage[pid] = ((buf[3] & 0xf) + 1)&0xf;
445
		};
446
		/* end check */
447
	};
445
                                if ((buf[3] & 0xf) != demux->cnt_storage[pid]) {
446
                                        dprintk_tscheck("TS packet counter mismatch. PID=0x%x expected 0x%x got 0x%x\n",
447
                                                pid, demux->cnt_storage[pid],
448
                                                buf[3] & 0xf);
449
                                        demux->cnt_storage[pid] = buf[3] & 0xf;
450
                                }
451
                        }
452
                        /* end check */
453
                }
448 454

  
449 455
	list_for_each_entry(feed, &demux->feed_list, list_head) {
450 456
		if ((feed->pid != pid) && (feed->pid != 0x2000))
(1-1/2)