From 89d39d7ea0a4d7222704a380c6330ea9d0c47780 Mon Sep 17 00:00:00 2001 From: Andreas Oberritter Date: Wed, 14 Jan 2004 21:07:34 +0000 Subject: corrected bug in dvb_demux.c:1.44->1.45: (e.g. starting a ts filter on a running section filter's pid did break the section filter) --- linux/drivers/media/dvb/dvb-core/dvb_demux.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'linux/drivers/media') diff --git a/linux/drivers/media/dvb/dvb-core/dvb_demux.c b/linux/drivers/media/dvb/dvb-core/dvb_demux.c index cea42769e..bbd18db2c 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_demux.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_demux.c @@ -397,6 +397,11 @@ static inline void dvb_dmx_swfilter_packet_type(struct dvb_demux_feed *feed, con } } +#define DVR_FEED(f) \ + (((f)->type == DMX_TYPE_TS) && \ + ((f)->feed.ts.is_filtering) && \ + (((f)->ts_type & (TS_PACKET|TS_PAYLOAD_ONLY)) == TS_PACKET)) + void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf) { struct dvb_demux_feed *feed; @@ -406,16 +411,21 @@ void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf) list_for_each(pos, head) { feed = list_entry(pos, struct dvb_demux_feed, list_head); + + if ((feed->pid != pid) && (feed->pid != 0x2000)) + continue; + + /* copy each packet only once to the dvr device, even + * if a PID is in multiple filters (e.g. video + PCR) */ + if ((DVR_FEED(feed)) && (dvr_done++)) + continue; + if (feed->pid == pid) { - /* copy each packet only once to the dvr device, even - * if a PID is in multiple filters (e.g. video + PCR) */ - if (!dvr_done) { - dvb_dmx_swfilter_packet_type (feed, buf); - if ((feed->ts_type & TS_PACKET) && - !(feed->ts_type & TS_PAYLOAD_ONLY)) - dvr_done = 1; - } + dvb_dmx_swfilter_packet_type(feed, buf); + if (DVR_FEED(feed)) + continue; } + if (feed->pid == 0x2000) feed->cb.ts(buf, 188, 0, 0, &feed->feed.ts, DMX_OK); } -- cgit v1.2.3