Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] master-timer 0.5.1 bugfix/enhancement



Hi,

while trying to get master-timer 0.5.1 to work on my VDR machine, I
discovered a bug when uselste is non-zero (this will read the EPG data
through SVDRP instead of the epg.data file. The original version of
master-timer 0.5.1 won't find any data because of a problem in the data
parsing routine in processprogram.pl.

I also noticed that it takes too long to fill up the array of response lines
in svdr.pl which causes VDR's watchdog timer to restart before all EPG data
has been read. I'm no Perl guru, but I think appending data to an array like
this: (@retval) = (@retval, $_); is very inefficient. That's why I rewrote
the while-loop.

I wonder why nobody else noticed these problems before ... am I the only one
using master-timer? Anyway, here is the patch ;-)

diff -ur master-timer-0.5.1.orig/processprogram.pl
master-timer-0.5.1/processprogram.pl
--- master-timer-0.5.1.orig/processprogram.pl   Mon Mar  4 00:27:57 2002
+++ master-timer-0.5.1/processprogram.pl        Sun Mar 24 21:03:32 2002
@@ -517,7 +517,7 @@
       @lines = (@lines,GetSend ($num, "LSTE"));
     }
     foreach $line (@lines) {
-      $line =~ s/^250[- ]//
+      $line =~ s/^\d+[- ]//;
     }
   } else {
     open (FI,"epg.data") or die ("Can't open file \"epg.data\"\n");
diff -ur master-timer-0.5.1.orig/svdr.pl master-timer-0.5.1/svdr.pl
--- master-timer-0.5.1.orig/svdr.pl     Fri Feb 22 21:55:15 2002
+++ master-timer-0.5.1/svdr.pl  Sun Mar 24 21:25:03 2002
@@ -57,15 +57,17 @@
 # Send a command to VDR and read back the result
 sub GetSend {
   no strict 'refs';
-  my ($socket, $command, @retval);
+  my ($socket, $command, @retval, $linenum);
   $socket = shift;
   $socket = "SOCKET$socket";

+  $linenum = 0;
   while ($command = shift){
     print $socket "$command\r\n";
     while (<$socket>) {
       s/\x0d//g;
-      (@retval) = (@retval, $_);
+      $retval[$linenum] = $_;
+      $linenum++;
       last if substr($_, 3, 1) ne "-";
     }
   }

Regards,
hh




Home | Main Index | Thread Index