Udo Richter wrote:
> Pjotr Kourzanov wrote:
>>   I am experiencing VDR errors when loading EPG via SVDRP. If the EPG
>> data to
>> be loaded is larger that 3 MB then VDR silently drops the SVDR
>> connection.
>>
>>   Everything is fine if the data is truncated to fit 3 megs.
> 
> There is an issue if the EPG download is too slow. In that case, the VDR
> watchdog timer may restart VDR to bring back VDR to life. You can try to
> increase the watchdog timeout value.
> VDRAdmin-AM can also read the epg data directly from the /video/epg.data
> file, avoiding the lengthly and slow SVDRP download.

I have recently sent the attached patch to Thomas Koch <[EMAIL PROTECTED]>.
It dramatically speeds up getting EPG information from VDR.

Klaus
--- vdradmind.pl	2006-12-23 13:36:30.353879013 +0100
+++ vdradmind-2.pl	2006-12-23 13:37:42.186068197 +0100
@@ -538,21 +538,22 @@
 
 sub EPG_buildTree {
 	$SVDRP->command("lste");
+	my @DATA = $SVDRP->readresponse;
+	CloseSocket();
   my($i, @events); 
 	my($id, $bc) = (1, 0); 
   undef(%EPG);
-	while($_ = $SVDRP->readoneline) {
-    chomp;
+	while($_ = shift @DATA) {
     if(/^C ([^ ]+) *(.*)/) {
       $bc++;
       undef(@events);
       my($channel_id, $channel_name) = ($1, $2);
 			my $vdr_id = get_vdrid_from_channelid($channel_id);
-			while($_ = $SVDRP->readoneline) {
+			while($_ = shift @DATA) {
 				if(/^E (.*) (.*) (.*) (.*)/ || /^E (.*) (.*) (.*)/) {
 					my($event_id, $time, $duration) = ($1, $2, $3);
 					my($title, $subtitle, $summary);
-					while($_ = $SVDRP->readoneline) {
+					while($_ = shift @DATA) {
 						if(/^T (.*)/) { $title = $1 }
 						if(/^S (.*)/) { $subtitle = $1 }
 						if(/^D (.*)/) { $summary = $1 }
@@ -3157,6 +3158,20 @@
 		return undef; 
 	}
 }
+
+sub readresponse {
+	my $this = shift;
+	my @a = ();
+	if($connected) {
+		while (<$SOCKET>) {
+			chomp;
+			my $end = substr($_, 3, 1) ne "-";
+			push(@a, substr($_, 4, length($_)));
+			last if ($end);
+		}
+	}
+	return @a;
+}
 #
 #############################################################################
 
_______________________________________________
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

Reply via email to