[mythtv] [PATCH] pcHDTV - Rewrite PIDs in PMT and PAT tables ofrecorded streams

Jason Schloer schloer.jason at tangoinc.com
Thu Oct 30 11:03:06 EST 2003


From: mythtv-dev-bounces at mythtv.org
[mailto:mythtv-dev-bounces at mythtv.org] On Behalf Of Jason Hoos
Sent: Thursday, October 30, 2003 3:38 AM
To: mythtv-dev at mythtv.org
Subject: [mythtv] [PATCH] pcHDTV - Rewrite PIDs in PMT and PAT tables
ofrecorded streams

Since I was bound and determined this week to get both of my whopping 2
HDTV 
stations working (I really need to get my condo association to fix the
roof 
antenna!), attached is another patch for hdtvrecorder.  This one adds
code to 
rewrite the stream PIDs that are in the PAT and PMT tables.  This came
about 
because one of the stations I get has 4 substations, and they list them
in 
reverse order in the PAT, which caused ffmpeg major headaches.
hdtvrecorder 
stripped out all but program 2 (they were numbered 2-5), and ffmpeg
tried to 
grab the first station that was listed in the PAT, which was program 5.
It 
then promptly died with an obscure "avformat error: -1" message.

This patch adds two private methods to hdtvreceiver called RewritePAT
and 
RewritePMT.  In addition to changing the PIDs in these tables to match
the 
PIDs that are really being written to disk, they also change the program

number of the output stream to 1.  Most importantly (with regards to the

above problem), RewritePAT removes mention of the other programs from
the PAT 
and leaves only the one that's actually in the file.

I've put this (and my previous patch) through a small battery of 
channel-changing and recording tests, and it seems to be working pretty
well 
for the two stations I can test it with.

- Jason



Eureka!
I'm not sure but I'm hoping you just fixed one of my bigger problems. I
would intermittently get that AVFormat error as well, but thought it was
just because of my hacked together redhat driver on mandrake or
something I did wrong. Anyway thanks for the help. I can't wait to try
the patch out. BTW, have you gotten your pchdtv working with any other
cards in the same machine? I'm looking into this now, but I haven't been
able to get mine to coexist. I removed the pchdtv and am now trying to
get my TV Wonder working by itself with the patched driver. I've made a
few changes and it mostly works, except that removing the bttv driver
causes a kernel panic. That was there before my changes though. Anyway,
I'll try to get my changes done tonight and a patch out soon. Really
excited about finally being able to do both HD an regular tv on my Myth
box. Thanks again,
-Jason S





More information about the mythtv-dev mailing list