summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_demux.c26
1 files changed, 18 insertions, 8 deletions
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);
}