--- ./utils/dvb/dvbv5-zap.c.ORIG	2014-09-07 19:37:14.000000000 +0300
+++ ./utils/dvb/dvbv5-zap.c	2016-06-16 12:35:59.325317929 +0300
@@ -48,6 +48,8 @@
 const char *argp_program_version = PROGRAM_NAME " version " V4L_UTILS_VERSION;
 const char *argp_program_bug_address = "Mauro Carvalho Chehab <m.chehab@samsung.com>";
 
+#define MAX_OPIDS 20
+
 struct arguments {
 	char *confname, *lnb_name, *output, *demux_dev, *dvr_dev;
 	char *filename;
@@ -59,6 +61,7 @@
 	enum dvb_file_formats input_format, output_format;
 	unsigned traffic_monitor, low_traffic;
 	char *search;
+	unsigned num_opids, n_opids[MAX_OPIDS];
 
 	/* Used by status print */
 	unsigned n_status_lines;
@@ -89,6 +92,7 @@
 	{"wait",	'W', "time",			0, "adds additional wait time for DISEqC command completion", 0},
 	{"exit",	'x', NULL,			0, "exit after tuning", 0},
 	{"low_traffic",	'X', NULL,			0, "also shows DVB traffic with less then 1 packet per second", 0},
+	{"other_pid",   'O', "pid#",                    0, "extra pids to use, repeat option for multiple pids", 0},
 	{ 0, 0, 0, 0, 0, 0 }
 };
 
@@ -549,6 +553,11 @@
 	case 'L':
 		args->search = strdup(optarg);
 		break;
+	case 'O':
+		if (args->num_opids >= MAX_OPIDS)
+			return E2BIG;
+		args->n_opids[args->num_opids++] = strtoul(optarg, NULL, 0);
+		break;
 	default:
 		return ARGP_ERR_UNKNOWN;
 	};
@@ -715,7 +724,8 @@
 	int audio_fd = -1, video_fd = -1;
 	int dvr_fd = -1, file_fd = -1;
 	int err = -1;
-	int r;
+	int r, i;
+	int opid_fds[MAX_OPIDS];
 	struct dvb_v5_fe_parms *parms = NULL;
 	const struct argp argp = {
 		.options = options,
@@ -724,6 +734,9 @@
 		.args_doc = "<channel name> [or <frequency> if in monitor mode]",
 	};
 
+	for (i = 0; i < MAX_OPIDS; i++)
+		opid_fds[i] = -1;
+
 	memset(&args, 0, sizeof(args));
 	args.sat_number = -1;
 	args.lna = LNA_AUTO;
@@ -915,6 +928,21 @@
 			goto err;
 	}
 
+	for (i = 0; i < args.num_opids; i++) {
+		if (args.silent < 2)
+			fprintf(stderr, "other pid %d\n", args.n_opids[i]);
+		if ((opid_fds[i] = open(args.demux_dev, O_RDWR)) < 0) {
+			PERROR("failed opening '%s'", args.demux_dev);
+			goto err;
+		}
+		if (args.silent < 2)
+			fprintf(stderr, "  dvb_set_pesfilter %d\n", args.n_opids[i]);
+		if (dvb_set_pesfilter(opid_fds[i], args.n_opids[i], DMX_PES_OTHER,
+				args.dvr ? DMX_OUT_TS_TAP : DMX_OUT_DECODER,
+				args.dvr ? 64 * 1024 : 0) < 0)
+			goto err;
+	}
+
 	signal(SIGALRM, do_timeout);
 	signal(SIGTERM, do_timeout);
 	if (args.timeout > 0) {
@@ -982,6 +1010,8 @@
 		close(audio_fd);
 	if (video_fd > 0)
 		close(video_fd);
+	for (i = 0; i < args.num_opids; i++)
+		close(opid_fds[i]);
 	if (parms)
 		dvb_fe_close(parms);
 	if (args.confname)
