public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] DVB-APPS: azap gets -p argument
@ 2011-03-05  2:16 Christian Ulrich
  2011-03-15 12:11 ` Janne Grunau
  0 siblings, 1 reply; 9+ messages in thread
From: Christian Ulrich @ 2011-03-05  2:16 UTC (permalink / raw)
  To: linux-media

[-- Attachment #1: Type: text/plain, Size: 270 bytes --]

Hey there,

I've written a patch against the latest version of azap in the hg
repository during the work of my Archos Gen8 DVB-T / ATSC project.

Details of patch:
- add -p argument from tzap to azap
- thus ts streaming to dvr0 includes the pat/pmt

Best regards,
Chris

[-- Attachment #2: azap_patpmt.patch --]
[-- Type: application/octet-stream, Size: 2977 bytes --]

--- linuxtv-dvb-apps/util/szap/azap.c.orig	2011-03-04 11:43:00.133757001 +0100
+++ linuxtv-dvb-apps/util/szap/azap.c	2011-03-05 02:15:31.289756443 +0100
@@ -171,7 +171,7 @@
 
 
 int parse(const char *fname, const char *channel,
-	  struct dvb_frontend_parameters *frontend, int *vpid, int *apid)
+	  struct dvb_frontend_parameters *frontend, int *vpid, int *apid, int *sid)
 {
 	int fd;
 	int err;
@@ -204,6 +204,9 @@
 	if ((err = try_parse_int(fd, apid, "Audio PID")))
 		return -6;
 
+	if ((err = try_parse_int(fd, sid, "Service ID")))
+		return -7;
+
 	close(fd);
 
 	return 0;
@@ -266,7 +269,7 @@
 }
 
 
-static const char *usage = "\nusage: %s [-a adapter_num] [-f frontend_id] [-d demux_id] [-c conf_file] [-r] <channel name>\n\n";
+static const char *usage = "\nusage: %s [-a adapter_num] [-f frontend_id] [-d demux_id] [-c conf_file] [-r] [-p] <channel name>\n\n";
 
 
 int main(int argc, char **argv)
@@ -276,11 +279,13 @@
 	char *confname = NULL;
 	char *channel = NULL;
 	int adapter = 0, frontend = 0, demux = 0, dvr = 0;
-	int vpid, apid;
+	int vpid, apid, sid, pmtpid = 0;
+	int pat_fd, pmt_fd;
 	int frontend_fd, audio_fd, video_fd;
 	int opt;
+	int rec_psi = 0;
 
-	while ((opt = getopt(argc, argv, "hrn:a:f:d:c:")) != -1) {
+	while ((opt = getopt(argc, argv, "hrpn:a:f:d:c:")) != -1) {
 		switch (opt) {
 		case 'a':
 			adapter = strtoul(optarg, NULL, 0);
@@ -294,6 +299,9 @@
 		case 'r':
 			dvr = 1;
 			break;
+		case 'p':
+			rec_psi = 1;
+			break;
 		case 'c':
 			confname = optarg;
 			break;
@@ -333,7 +341,7 @@
 
 	memset(&frontend_param, 0, sizeof(struct dvb_frontend_parameters));
 
-	if (parse (confname, channel, &frontend_param, &vpid, &apid))
+	if (parse (confname, channel, &frontend_param, &vpid, &apid, &sid))
 		return -1;
 
 	if ((frontend_fd = open(FRONTEND_DEV, O_RDWR)) < 0) {
@@ -344,6 +352,29 @@
 	if (setup_frontend (frontend_fd, &frontend_param) < 0)
 		return -1;
 
+
+        if (rec_psi) {
+            pmtpid = get_pmt_pid(DEMUX_DEV, sid);
+            if (pmtpid <= 0) {
+                fprintf(stderr,"couldn't find pmt-pid for sid %04x\n",sid);
+                return -1;
+            }
+
+            if ((pat_fd = open(DEMUX_DEV, O_RDWR)) < 0) {
+                perror("opening pat demux failed");
+                return -1;
+            }
+            if (set_pesfilter(pat_fd, 0, DMX_PES_OTHER, dvr) < 0)
+                return -1;
+
+            if ((pmt_fd = open(DEMUX_DEV, O_RDWR)) < 0) {
+                perror("opening pmt demux failed");
+                return -1;
+            }
+            if (set_pesfilter(pmt_fd, pmtpid, DMX_PES_OTHER, dvr) < 0)
+                return -1;
+        }
+
         if ((video_fd = open(DEMUX_DEV, O_RDWR)) < 0) {
                 PERROR("failed opening '%s'", DEMUX_DEV);
                 return -1;
@@ -363,6 +394,8 @@
 
 	check_frontend (frontend_fd);
 
+        close (pat_fd);
+        close (pmt_fd);
 	close (audio_fd);
 	close (video_fd);
 	close (frontend_fd);

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] DVB-APPS: azap gets -p argument
  2011-03-05  2:16 [PATCH] DVB-APPS: azap gets -p argument Christian Ulrich
@ 2011-03-15 12:11 ` Janne Grunau
  2011-03-15 12:23   ` Christian Ulrich
  0 siblings, 1 reply; 9+ messages in thread
From: Janne Grunau @ 2011-03-15 12:11 UTC (permalink / raw)
  To: Christian Ulrich; +Cc: linux-media

Hi,

On Sat, Mar 05, 2011 at 03:16:51AM +0100, Christian Ulrich wrote:
> 
> I've written a patch against the latest version of azap in the hg
> repository during the work of my Archos Gen8 DVB-T / ATSC project.
> 
> Details of patch:
> - add -p argument from tzap to azap
> - thus ts streaming to dvr0 includes the pat/pmt

I would prefer if you simply add PAT/PMT filters to -r. I'll send a
patch which does the same for [cst]zap. The reulting files without
PAT/PMT are simply invalid. It wasn't a serious problem as long as
the used codecs were always mpeg2 video and mpeg1 layer 2 audio but
that has changed.
Since people use "[acst]zap -r" + cat/dd/... for recording we should
make the life of playback software easier by producing valid files.

patch looks good otherwise. thanks

Janne

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] DVB-APPS: azap gets -p argument
  2011-03-15 12:11 ` Janne Grunau
@ 2011-03-15 12:23   ` Christian Ulrich
  2011-03-15 12:32     ` Janne Grunau
  0 siblings, 1 reply; 9+ messages in thread
From: Christian Ulrich @ 2011-03-15 12:23 UTC (permalink / raw)
  To: Janne Grunau; +Cc: linux-media

Hi, thank you for your feedback.

Indeed, I never used -r alone, but only with -p.
So with your patch, [acst]zap -r will be the same as -rp. That looks good to me.

Chris

2011/3/15 Janne Grunau <j@jannau.net>:
> Hi,
>
> On Sat, Mar 05, 2011 at 03:16:51AM +0100, Christian Ulrich wrote:
>>
>> I've written a patch against the latest version of azap in the hg
>> repository during the work of my Archos Gen8 DVB-T / ATSC project.
>>
>> Details of patch:
>> - add -p argument from tzap to azap
>> - thus ts streaming to dvr0 includes the pat/pmt
>
> I would prefer if you simply add PAT/PMT filters to -r. I'll send a
> patch which does the same for [cst]zap. The reulting files without
> PAT/PMT are simply invalid. It wasn't a serious problem as long as
> the used codecs were always mpeg2 video and mpeg1 layer 2 audio but
> that has changed.
> Since people use "[acst]zap -r" + cat/dd/... for recording we should
> make the life of playback software easier by producing valid files.
>
> patch looks good otherwise. thanks
>
> Janne
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] DVB-APPS: azap gets -p argument
  2011-03-15 12:23   ` Christian Ulrich
@ 2011-03-15 12:32     ` Janne Grunau
  2011-03-15 13:50       ` Oliver Endriss
  0 siblings, 1 reply; 9+ messages in thread
From: Janne Grunau @ 2011-03-15 12:32 UTC (permalink / raw)
  To: Christian Ulrich; +Cc: linux-media

[-- Attachment #1: Type: text/plain, Size: 378 bytes --]

On Tue, Mar 15, 2011 at 01:23:40PM +0100, Christian Ulrich wrote:
> Hi, thank you for your feedback.
> 
> Indeed, I never used -r alone, but only with -p.
> So with your patch, [acst]zap -r will be the same as -rp. That looks good to me.

well, azap not yet. iirc I implemented -p for azap but it was never
applied since nobody tested it. see attached patch for [cst]zap

Janne

[-- Attachment #2: dvb_apps_cstzap_always_record_pat_pmt.diff --]
[-- Type: text/plain, Size: 2423 bytes --]

diff -r 4746d76ae4b6 util/szap/czap.c
--- a/util/szap/czap.c	Sat Mar 05 18:39:58 2011 +0100
+++ b/util/szap/czap.c	Tue Mar 15 13:32:29 2011 +0100
@@ -253,7 +253,7 @@
     "     -x        : exit after tuning\n"
     "     -H        : human readable output\n"
     "     -r        : set up /dev/dvb/adapterX/dvr0 for TS recording\n"
-    "     -p        : add pat and pmt to TS recording (implies -r)\n"
+    "     -p        : obsolete (pat and pmt will always be included with -r)\n"
 ;
 
 int main(int argc, char **argv)
@@ -279,8 +279,11 @@
 		case 'd':
 			demux = strtoul(optarg, NULL, 0);
 			break;
+		case 'p':
+			printf("'-p' is obsolete. '-r' records PAT/PMT");
 		case 'r':
 			dvr = 1;
+			rec_psi = 1;
 			break;
 		case 'l':
 			list_channels = 1;
@@ -288,9 +291,6 @@
 		case 'n':
 			chan_no = strtoul(optarg, NULL, 0);
 			break;
-		case 'p':
-			rec_psi = 1;
-			break;
 		case 'x':
 			exit_after_tuning = 1;
 			break;
diff -r 4746d76ae4b6 util/szap/szap.c
--- a/util/szap/szap.c	Sat Mar 05 18:39:58 2011 +0100
+++ b/util/szap/szap.c	Tue Mar 15 13:32:29 2011 +0100
@@ -547,8 +547,11 @@
 	 case 'q':
 	    list_channels = 1;
 	    break;
+	 case 'p':
+	    printf("'-p' is obsolete. '-r' records PAT/PMT");
 	 case 'r':
 	    dvr = 1;
+	    rec_psi = 1;
 	    break;
 	 case 'n':
 	    chan_no = strtoul(optarg, NULL, 0);
@@ -559,9 +562,6 @@
 	 case 'f':
 	    frontend = strtoul(optarg, NULL, 0);
 	    break;
-	 case 'p':
-	    rec_psi = 1;
-	    break;
 	 case 'd':
 	    demux = strtoul(optarg, NULL, 0);
 	    break;
diff -r 4746d76ae4b6 util/szap/tzap.c
--- a/util/szap/tzap.c	Sat Mar 05 18:39:58 2011 +0100
+++ b/util/szap/tzap.c	Tue Mar 15 13:32:29 2011 +0100
@@ -485,7 +485,7 @@
     "     -c file   : read channels list from 'file'\n"
     "     -x        : exit after tuning\n"
     "     -r        : set up /dev/dvb/adapterX/dvr0 for TS recording\n"
-    "     -p        : add pat and pmt to TS recording (implies -r)\n"
+    "     -p        : obsolete (pat and pmt will always be included with -r)\n"
     "     -s        : only print summary\n"
     "     -S        : run silently (no output)\n"
     "     -H        : human readable output\n"
@@ -529,10 +529,10 @@
 			filename = strdup(optarg);
 			record=1;
 			/* fall through */
+		case 'p':
+			printf("'-p' is obsolete. '-r' records PAT/PMT");
 		case 'r':
 			dvr = 1;
-			break;
-		case 'p':
 			rec_psi = 1;
 			break;
 		case 'x':

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] DVB-APPS: azap gets -p argument
  2011-03-15 12:32     ` Janne Grunau
@ 2011-03-15 13:50       ` Oliver Endriss
  2011-04-04 11:05         ` Janne Grunau
  0 siblings, 1 reply; 9+ messages in thread
From: Oliver Endriss @ 2011-03-15 13:50 UTC (permalink / raw)
  To: Janne Grunau; +Cc: Christian Ulrich, linux-media

On Tuesday 15 March 2011 13:32:58 Janne Grunau wrote:
> On Tue, Mar 15, 2011 at 01:23:40PM +0100, Christian Ulrich wrote:
> > Hi, thank you for your feedback.
> > 
> > Indeed, I never used -r alone, but only with -p.
> > So with your patch, [acst]zap -r will be the same as -rp. That looks good to me.
> 
> well, azap not yet. iirc I implemented -p for azap but it was never
> applied since nobody tested it. see attached patch for [cst]zap

NAK.

The PAT/PMT from the stream does not describe the dvr stream correctly.

The dvr device provides *some* PIDs of the transponder, while the
PAT/PMT reference *all* programs of the transponder.

For correct results the PAT/PMT has to be re-created.

The separate -p option seems acceptable - as a debug feature.

CU
Oliver

-- 
----------------------------------------------------------------
VDR Remote Plugin 0.4.0: http://www.escape-edv.de/endriss/vdr/
4 MByte Mod: http://www.escape-edv.de/endriss/dvb-mem-mod/
Full-TS Mod: http://www.escape-edv.de/endriss/dvb-full-ts-mod/
----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] DVB-APPS: azap gets -p argument
  2011-03-15 13:50       ` Oliver Endriss
@ 2011-04-04 11:05         ` Janne Grunau
  2011-04-06  6:39           ` Oliver Endriss
  0 siblings, 1 reply; 9+ messages in thread
From: Janne Grunau @ 2011-04-04 11:05 UTC (permalink / raw)
  To: Oliver Endriss; +Cc: linux-media

On Tue, Mar 15, 2011 at 02:50:05PM +0100, Oliver Endriss wrote:
> On Tuesday 15 March 2011 13:32:58 Janne Grunau wrote:
> > On Tue, Mar 15, 2011 at 01:23:40PM +0100, Christian Ulrich wrote:
> > > Hi, thank you for your feedback.
> > > 
> > > Indeed, I never used -r alone, but only with -p.
> > > So with your patch, [acst]zap -r will be the same as -rp. That looks good to me.
> > 
> > well, azap not yet. iirc I implemented -p for azap but it was never
> > applied since nobody tested it. see attached patch for [cst]zap
> 
> NAK.

I think we had the same discussion when I submitted -p for czap and
tzap.

> The PAT/PMT from the stream does not describe the dvr stream correctly.
> 
> The dvr device provides *some* PIDs of the transponder, while the
> PAT/PMT reference *all* programs of the transponder.

True, the PAT references some PMT pids which won't be included. All pids
from the desired program should be included. A transport stream without
PAT/PMT is as invalid as the stream with incorrect PAT/PMT/missing pids
but the second is easier to handle for player software than the first.

> For correct results the PAT/PMT has to be re-created.

That's not possible from ?zap and I hope you don't suggest we add
PMT/PAT rewriting routines to kernel software demuxer.

> The separate -p option seems acceptable - as a debug feature.

-r is as much a debug feature as -p. the output is invalid too

Janne

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] DVB-APPS: azap gets -p argument
  2011-04-04 11:05         ` Janne Grunau
@ 2011-04-06  6:39           ` Oliver Endriss
  2011-04-06  7:15             ` Janne Grunau
  0 siblings, 1 reply; 9+ messages in thread
From: Oliver Endriss @ 2011-04-06  6:39 UTC (permalink / raw)
  To: Janne Grunau; +Cc: linux-media

On Monday 04 April 2011 13:05:19 Janne Grunau wrote:
> On Tue, Mar 15, 2011 at 02:50:05PM +0100, Oliver Endriss wrote:
> > On Tuesday 15 March 2011 13:32:58 Janne Grunau wrote:
> > > On Tue, Mar 15, 2011 at 01:23:40PM +0100, Christian Ulrich wrote:
> > > > Hi, thank you for your feedback.
> > > > 
> > > > Indeed, I never used -r alone, but only with -p.
> > > > So with your patch, [acst]zap -r will be the same as -rp. That looks good to me.
> > > 
> > > well, azap not yet. iirc I implemented -p for azap but it was never
> > > applied since nobody tested it. see attached patch for [cst]zap
> > 
> > NAK.
> 
> I think we had the same discussion when I submitted -p for czap and
> tzap.

I don't care about an additional option, but the behaviour with option
'-r' should not change. There is no need to do so.

> > The PAT/PMT from the stream does not describe the dvr stream correctly.
> > 
> > The dvr device provides *some* PIDs of the transponder, while the
> > PAT/PMT reference *all* programs of the transponder.
> 
> True, the PAT references some PMT pids which won't be included. All pids
> from the desired program should be included. A transport stream without
> PAT/PMT is as invalid as the stream with incorrect PAT/PMT/missing pids
> but the second is easier to handle for player software than the first.

A sane player can handle a TS stream without PAT/PMT.
Iirc mplayer never had any problems.

> > For correct results the PAT/PMT has to be re-created.
> 
> That's not possible from ?zap and I hope you don't suggest we add
> PMT/PAT rewriting routines to kernel software demuxer.

No. ;-)

> > The separate -p option seems acceptable - as a debug feature.
> 
> -r is as much a debug feature as -p. the output is invalid too

With separate options, you have a choice. So implement a separate option
'-p', and everything is fine.

CU
Oliver

-- 
----------------------------------------------------------------
VDR Remote Plugin 0.4.0: http://www.escape-edv.de/endriss/vdr/
4 MByte Mod: http://www.escape-edv.de/endriss/dvb-mem-mod/
Full-TS Mod: http://www.escape-edv.de/endriss/dvb-full-ts-mod/
----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] DVB-APPS: azap gets -p argument
  2011-04-06  6:39           ` Oliver Endriss
@ 2011-04-06  7:15             ` Janne Grunau
  2011-09-15 17:09               ` Christian Ulrich
  0 siblings, 1 reply; 9+ messages in thread
From: Janne Grunau @ 2011-04-06  7:15 UTC (permalink / raw)
  To: linux-media

On Wed, Apr 06, 2011 at 08:39:05AM +0200, Oliver Endriss wrote:
> On Monday 04 April 2011 13:05:19 Janne Grunau wrote:
> > On Tue, Mar 15, 2011 at 02:50:05PM +0100, Oliver Endriss wrote:
> > > The PAT/PMT from the stream does not describe the dvr stream correctly.
> > > 
> > > The dvr device provides *some* PIDs of the transponder, while the
> > > PAT/PMT reference *all* programs of the transponder.
> > 
> > True, the PAT references some PMT pids which won't be included. All pids
> > from the desired program should be included. A transport stream without
> > PAT/PMT is as invalid as the stream with incorrect PAT/PMT/missing pids
> > but the second is easier to handle for player software than the first.
> 
> A sane player can handle a TS stream without PAT/PMT.
> Iirc mplayer never had any problems.

mplayer with default options has only no problems as long as the video
codec is mpeg2 and possible mpeg 1 layer 2 audio. Try any H.264 stream
and see it fail. That was the reason why I want to change the behaviour
with -r in the first place. http://blog.fefe.de/?ts=b58fb6b1 (german
content) triggered it.

I don't care too much. Can someone please push Christian's original
patch adding -p to azap.

Janne

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] DVB-APPS: azap gets -p argument
  2011-04-06  7:15             ` Janne Grunau
@ 2011-09-15 17:09               ` Christian Ulrich
  0 siblings, 0 replies; 9+ messages in thread
From: Christian Ulrich @ 2011-09-15 17:09 UTC (permalink / raw)
  To: linux-media

[-- Attachment #1: Type: text/plain, Size: 1552 bytes --]

Patch still not pushed?

2011/4/6 Janne Grunau <j@jannau.net>:
> On Wed, Apr 06, 2011 at 08:39:05AM +0200, Oliver Endriss wrote:
>> On Monday 04 April 2011 13:05:19 Janne Grunau wrote:
>> > On Tue, Mar 15, 2011 at 02:50:05PM +0100, Oliver Endriss wrote:
>> > > The PAT/PMT from the stream does not describe the dvr stream correctly.
>> > >
>> > > The dvr device provides *some* PIDs of the transponder, while the
>> > > PAT/PMT reference *all* programs of the transponder.
>> >
>> > True, the PAT references some PMT pids which won't be included. All pids
>> > from the desired program should be included. A transport stream without
>> > PAT/PMT is as invalid as the stream with incorrect PAT/PMT/missing pids
>> > but the second is easier to handle for player software than the first.
>>
>> A sane player can handle a TS stream without PAT/PMT.
>> Iirc mplayer never had any problems.
>
> mplayer with default options has only no problems as long as the video
> codec is mpeg2 and possible mpeg 1 layer 2 audio. Try any H.264 stream
> and see it fail. That was the reason why I want to change the behaviour
> with -r in the first place. http://blog.fefe.de/?ts=b58fb6b1 (german
> content) triggered it.
>
> I don't care too much. Can someone please push Christian's original
> patch adding -p to azap.
>
> Janne
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

[-- Attachment #2: azap_patpmt.patch --]
[-- Type: application/octet-stream, Size: 2977 bytes --]

--- linuxtv-dvb-apps/util/szap/azap.c.orig	2011-03-04 11:43:00.133757001 +0100
+++ linuxtv-dvb-apps/util/szap/azap.c	2011-03-05 02:15:31.289756443 +0100
@@ -171,7 +171,7 @@
 
 
 int parse(const char *fname, const char *channel,
-	  struct dvb_frontend_parameters *frontend, int *vpid, int *apid)
+	  struct dvb_frontend_parameters *frontend, int *vpid, int *apid, int *sid)
 {
 	int fd;
 	int err;
@@ -204,6 +204,9 @@
 	if ((err = try_parse_int(fd, apid, "Audio PID")))
 		return -6;
 
+	if ((err = try_parse_int(fd, sid, "Service ID")))
+		return -7;
+
 	close(fd);
 
 	return 0;
@@ -266,7 +269,7 @@
 }
 
 
-static const char *usage = "\nusage: %s [-a adapter_num] [-f frontend_id] [-d demux_id] [-c conf_file] [-r] <channel name>\n\n";
+static const char *usage = "\nusage: %s [-a adapter_num] [-f frontend_id] [-d demux_id] [-c conf_file] [-r] [-p] <channel name>\n\n";
 
 
 int main(int argc, char **argv)
@@ -276,11 +279,13 @@
 	char *confname = NULL;
 	char *channel = NULL;
 	int adapter = 0, frontend = 0, demux = 0, dvr = 0;
-	int vpid, apid;
+	int vpid, apid, sid, pmtpid = 0;
+	int pat_fd, pmt_fd;
 	int frontend_fd, audio_fd, video_fd;
 	int opt;
+	int rec_psi = 0;
 
-	while ((opt = getopt(argc, argv, "hrn:a:f:d:c:")) != -1) {
+	while ((opt = getopt(argc, argv, "hrpn:a:f:d:c:")) != -1) {
 		switch (opt) {
 		case 'a':
 			adapter = strtoul(optarg, NULL, 0);
@@ -294,6 +299,9 @@
 		case 'r':
 			dvr = 1;
 			break;
+		case 'p':
+			rec_psi = 1;
+			break;
 		case 'c':
 			confname = optarg;
 			break;
@@ -333,7 +341,7 @@
 
 	memset(&frontend_param, 0, sizeof(struct dvb_frontend_parameters));
 
-	if (parse (confname, channel, &frontend_param, &vpid, &apid))
+	if (parse (confname, channel, &frontend_param, &vpid, &apid, &sid))
 		return -1;
 
 	if ((frontend_fd = open(FRONTEND_DEV, O_RDWR)) < 0) {
@@ -344,6 +352,29 @@
 	if (setup_frontend (frontend_fd, &frontend_param) < 0)
 		return -1;
 
+
+        if (rec_psi) {
+            pmtpid = get_pmt_pid(DEMUX_DEV, sid);
+            if (pmtpid <= 0) {
+                fprintf(stderr,"couldn't find pmt-pid for sid %04x\n",sid);
+                return -1;
+            }
+
+            if ((pat_fd = open(DEMUX_DEV, O_RDWR)) < 0) {
+                perror("opening pat demux failed");
+                return -1;
+            }
+            if (set_pesfilter(pat_fd, 0, DMX_PES_OTHER, dvr) < 0)
+                return -1;
+
+            if ((pmt_fd = open(DEMUX_DEV, O_RDWR)) < 0) {
+                perror("opening pmt demux failed");
+                return -1;
+            }
+            if (set_pesfilter(pmt_fd, pmtpid, DMX_PES_OTHER, dvr) < 0)
+                return -1;
+        }
+
         if ((video_fd = open(DEMUX_DEV, O_RDWR)) < 0) {
                 PERROR("failed opening '%s'", DEMUX_DEV);
                 return -1;
@@ -363,6 +394,8 @@
 
 	check_frontend (frontend_fd);
 
+        close (pat_fd);
+        close (pmt_fd);
 	close (audio_fd);
 	close (video_fd);
 	close (frontend_fd);

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-09-15 17:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-05  2:16 [PATCH] DVB-APPS: azap gets -p argument Christian Ulrich
2011-03-15 12:11 ` Janne Grunau
2011-03-15 12:23   ` Christian Ulrich
2011-03-15 12:32     ` Janne Grunau
2011-03-15 13:50       ` Oliver Endriss
2011-04-04 11:05         ` Janne Grunau
2011-04-06  6:39           ` Oliver Endriss
2011-04-06  7:15             ` Janne Grunau
2011-09-15 17:09               ` Christian Ulrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox