[mythtv] segfault with mithfilldatabase

Christian Hoenig mythtv-dev@snowman.net
Sun, 17 Nov 2002 15:02:03 +0100


Hi,

Am Sonntag, 17. November 2002 14:44 schrieb David Klotz:
> hi everyone,
> i'm experiencing exactly the same problems as
> Daniel Paessler reported some time ago on this list (i found that post
> in the archives):
>
> i'm in germany and i have got cable, and when i run mythfilldatabase
[snip]
> my guess (because both affected users are using tv_grab_de) is,
> that there could be a problem importing the xmltv file into the database
> because of the german umlauts (ä,ö,ü,ß) in it or something like that.

No, its because tv_grab_de is returning faulty data to mythfilldb.

I have made a patch for tv_grab_de to fix this, but I will change to a new 
system, using nxtvepg for retrieving the tv.xml files.

This is the patch, I hope it works.

--- tv_grab_de  2002-09-20 00:12:36.000000000 +0200
+++ /home/chris/misc/make/MYTHTV/xmltv-0.5.2/grab/de/tv_grab_de 2002-11-17 
01:16:32.000000000 +0100
@@ -150,6 +150,8 @@
 my $bar = new Term::ProgressBar('downloading listings', scalar @to_get)
   if $have_bar;
 my @listingses;
+
+
 foreach (@to_get) {
     my $xml;
     {
@@ -160,12 +162,41 @@

        # Fix empty 'length' elements that wrongly appear in the XML.
        $xml =~ s!<length[^>]*></length>!!g;
+       $xml =~ s/\ \+0100/00 +0100/g;
+
+       $xml =~ s/RTL\ 2/RTL_2/g;
+       $xml =~ s/Kabel\ 1/Kabel_1/g;
+       $xml =~ s/Super\ RTL/Super_RTL/g;
+       $xml =~ s/NORD\ 3/NORD_3/g;
+       $xml =~ s/Arte\ \(ge\)/Arte/g;
+       $xml =~ s/Berlin\ 1/Berlin_1/g;
+       $xml =~ s/Hessen\ Fernse/Hessen_Fernse/g;
+       $xml =~ s/ORF\ 1/ORF_1/g;
+       $xml =~ s/ORF\ 2/ORF_2/g;
+       $xml =~ s/SF\ 1/SF_1/g;
+       $xml =~ s/SF\ 2/SF_2/g;
+       $xml =~ s/Tele\ Club/Tele_Club/g;
+       $xml =~ s/Bayern3/Bayern_3/g;
+
        t 'after removing empty <length>: ' . d $xml;
     }

     push @listingses, XMLTV::parse($xml);
     update $bar if $have_bar;
 }
+
+my $file = '/tmp/channels';     # Name the file
+open(CHANFILE, $file);              # Open the file
+my $line;
+foreach my $l (<CHANFILE>) {
+        $line .= $l;
+}
+
+close(CHANFILE);
+
+push @listingses, XMLTV::parse($line);
+
+
 my %w_args = ();
 if (defined $opt_output) {
     my $fh = new IO::File ">$opt_output";

take care, have fun
/christian