Skip to content

Commit 7efb10d

Browse files
YooYong-Sumchehab
authored andcommitted
media: dvb_demux: fix a bug for the continuity counter
In dvb_demux.c, some logics exist which compare the expected continuity counter and the real continuity counter. If they are not matched each other, both of the expected continuity counter and the real continuity counter should be printed. But there exists a bug that the expected continuity counter is not correctly printed. The expected continuity counter is replaced with the real countinuity counter + 1 so that the epected continuity counter is not correclty printed. This is wrong. This bug is fixed. Link: https://lore.kernel.org/linux-media/20230305212519.499-1-yongsuyoo0215@gmail.com Signed-off-by: YongSu Yoo <yongsuyoo0215@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
1 parent 53558de commit 7efb10d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/media/dvb-core/dvb_demux.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,12 @@ static inline int dvb_dmx_swfilter_payload(struct dvb_demux_feed *feed,
115115

116116
cc = buf[3] & 0x0f;
117117
ccok = ((feed->cc + 1) & 0x0f) == cc;
118-
feed->cc = cc;
119118
if (!ccok) {
120119
set_buf_flags(feed, DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED);
121120
dprintk_sect_loss("missed packet: %d instead of %d!\n",
122121
cc, (feed->cc + 1) & 0x0f);
123122
}
123+
feed->cc = cc;
124124

125125
if (buf[1] & 0x40) // PUSI ?
126126
feed->peslen = 0xfffa;
@@ -300,7 +300,6 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed,
300300

301301
cc = buf[3] & 0x0f;
302302
ccok = ((feed->cc + 1) & 0x0f) == cc;
303-
feed->cc = cc;
304303

305304
if (buf[3] & 0x20) {
306305
/* adaption field present, check for discontinuity_indicator */
@@ -336,6 +335,7 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed,
336335
feed->pusi_seen = false;
337336
dvb_dmx_swfilter_section_new(feed);
338337
}
338+
feed->cc = cc;
339339

340340
if (buf[1] & 0x40) {
341341
/* PUSI=1 (is set), section boundary is here */

0 commit comments

Comments
 (0)