Previously, the macro DVR_FEED, which is used to recognize and filter
out duplicate packets going to the DVR device, used the TS_PAYLOAD_ONLY
flag to identify a packet's destination.

This kind of filtering was introduced by the following two changesets:
http://linuxtv.org/hg/v4l-dvb/rev/3544d62df713
http://linuxtv.org/hg/v4l-dvb/rev/a97d77b0395f

Now, that it is possible to record TS PIDs using the demux device by
setting the output type to DMX_OUT_TSDEMUX_TAP, checking TS_PAYLOAD_ONLY
is not sufficient anymore. Therefore another flag, TS_DEMUX, is added to
specify the output type of a feed.

This allows multiple clients to filter the same TS PID on a demux device
simultaneously.

Signed-off-by: Andreas Oberritter <[EMAIL PROTECTED]>

diff -r d2e0141b9198 linux/drivers/media/dvb/dvb-core/demux.h
--- a/linux/drivers/media/dvb/dvb-core/demux.h	Tue Mar 04 10:40:05 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-core/demux.h	Wed Mar 05 01:20:15 2008 +0100
@@ -80,6 +80,8 @@ enum dmx_success {
 #define	TS_PAYLOAD_ONLY 2   /* in case TS_PACKET is set, only send the TS
 			       payload (<=184 bytes per packet) to callback */
 #define TS_DECODER      4   /* send stream to built-in decoder (if present) */
+#define TS_DEMUX        8   /* in case TS_PACKET is set, send the TS to
+			       the demux device, not to the dvr device */
 
 /* PES type for filters which write to built-in decoder */
 /* these should be kept identical to the types in dmx.h */
diff -r d2e0141b9198 linux/drivers/media/dvb/dvb-core/dmxdev.c
--- a/linux/drivers/media/dvb/dvb-core/dmxdev.c	Tue Mar 04 10:40:05 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-core/dmxdev.c	Wed Mar 05 01:20:15 2008 +0100
@@ -619,11 +619,12 @@ static int dvb_dmxdev_filter_start(struc
 		else
 			ts_type = 0;
 
-		if (otype == DMX_OUT_TS_TAP || otype == DMX_OUT_TSDEMUX_TAP)
+		if (otype == DMX_OUT_TS_TAP)
 			ts_type |= TS_PACKET;
-
-		if (otype == DMX_OUT_TAP)
-			ts_type |= TS_PAYLOAD_ONLY | TS_PACKET;
+		else if (otype == DMX_OUT_TSDEMUX_TAP)
+			ts_type |= TS_PACKET | TS_DEMUX;
+		else if (otype == DMX_OUT_TAP)
+			ts_type |= TS_PACKET | TS_DEMUX | TS_PAYLOAD_ONLY;
 
 		ret = dmxdev->demux->allocate_ts_feed(dmxdev->demux,
 						      tsfeed,
diff -r d2e0141b9198 linux/drivers/media/dvb/dvb-core/dvb_demux.c
--- a/linux/drivers/media/dvb/dvb-core/dvb_demux.c	Tue Mar 04 10:40:05 2008 -0300
+++ b/linux/drivers/media/dvb/dvb-core/dvb_demux.c	Wed Mar 05 01:20:15 2008 +0100
@@ -368,7 +368,7 @@ static inline void dvb_dmx_swfilter_pack
 #define DVR_FEED(f)							\
 	(((f)->type == DMX_TYPE_TS) &&					\
 	((f)->feed.ts.is_filtering) &&					\
-	(((f)->ts_type & (TS_PACKET|TS_PAYLOAD_ONLY)) == TS_PACKET))
+	(((f)->ts_type & (TS_PACKET | TS_DEMUX)) == TS_PACKET))
 
 static void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf)
 {
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

Reply via email to