[PATCH] dvb_demux: Transport stream continuity check fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: John Smith <johns90812@xxxxxxxxx>

diff --git a/drivers/media/dvb-core/dvb_demux.c
b/drivers/media/dvb-core/dvb_demux.c
index d319717..70a89c8 100644
--- a/drivers/media/dvb-core/dvb_demux.c
+++ b/drivers/media/dvb-core/dvb_demux.c
@@ -443,14 +443,18 @@ static void dvb_dmx_swfilter_packet(struct
dvb_demux *demux, const u8 *buf)
     if (demux->cnt_storage && dvb_demux_tscheck) {
         /* check pkt counter */
         if (pid < MAX_PID) {
-            if ((buf[3] & 0xf) != demux->cnt_storage[pid])
+            if (buf[3] & 0x10)
+                demux->cnt_storage[pid] =
+                    (demux->cnt_storage[pid] + 1) & 0xf;
+
+            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],
                         buf[3] & 0xf);
-
-            demux->cnt_storage[pid] = ((buf[3] & 0xf) + 1)&0xf;
+                demux->cnt_storage[pid] = buf[3] & 0xf;
+            }
         }
         /* end check */
     }
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux