Commit 5144f5b7 authored by John Smith's avatar John Smith Committed by Mauro Carvalho Chehab

[media] dvb_demux: Transport stream continuity check fix

This patch avoids incrementing continuity counter
demux->cnt_storage[pid] for TS packets without payload in accordance
with ISO /IEC 13818-1.

[mchehab@redhat.com: unmangle whitespacing and fix CodingStyle.
 Also checked ISO/IEC spec: patch is according with it]
Reviewed-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: default avatarJohn Smith <johns90812@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent fa7b9ac2
...@@ -440,20 +440,22 @@ static void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf) ...@@ -440,20 +440,22 @@ static void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf)
if (!dvb_demux_feed_err_pkts) if (!dvb_demux_feed_err_pkts)
return; return;
} else /* if TEI bit is set, pid may be wrong- skip pkt counter */ } else /* if TEI bit is set, pid may be wrong- skip pkt counter */
if (demux->cnt_storage && dvb_demux_tscheck) { if (demux->cnt_storage && dvb_demux_tscheck) {
/* check pkt counter */ /* check pkt counter */
if (pid < MAX_PID) { if (pid < MAX_PID) {
if ((buf[3] & 0xf) != demux->cnt_storage[pid]) if (buf[3] & 0x10)
dprintk_tscheck("TS packet counter mismatch. " demux->cnt_storage[pid] =
"PID=0x%x expected 0x%x " (demux->cnt_storage[pid] + 1) & 0xf;
"got 0x%x\n",
if ((buf[3] & 0xf) != demux->cnt_storage[pid]) {
dprintk_tscheck("TS packet counter mismatch. PID=0x%x expected 0x%x got 0x%x\n",
pid, demux->cnt_storage[pid], pid, demux->cnt_storage[pid],
buf[3] & 0xf); buf[3] & 0xf);
demux->cnt_storage[pid] = buf[3] & 0xf;
demux->cnt_storage[pid] = ((buf[3] & 0xf) + 1)&0xf; }
}
/* end check */
} }
/* end check */
}
list_for_each_entry(feed, &demux->feed_list, list_head) { list_for_each_entry(feed, &demux->feed_list, list_head) {
if ((feed->pid != pid) && (feed->pid != 0x2000)) if ((feed->pid != pid) && (feed->pid != 0x2000))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment