summaryrefslogtreecommitdiff
path: root/patches/lcdproc-0.0.10-epg-update.diff
blob: 980bb900ca47e9c5229d7d7fbccd5ea71a937006 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
diff -rup lcdproc-0.0.10.sav/lcd.c lcdproc-0.0.10/lcd.c
--- lcdproc-0.0.10.sav/lcd.c	Wed Nov  9 22:01:59 2005
+++ lcdproc-0.0.10/lcd.c	Thu Jan  5 16:52:01 2006
@@ -43,6 +43,7 @@ cLcd::cLcd() {
   for (i=0;i<LCDMAXSTATEBUF;i++) LastState[i]=Title; LastStateP=0;
   ThreadStateData.barx=1, ThreadStateData.bary=1, ThreadStateData.barl=0; 
   for (i=0;i<LCDMAXCARDS;i++) ThreadStateData.CardStat[i]=0;
+  channelSwitched = false;
 }
 
 cLcd::~cLcd() {
@@ -667,12 +668,15 @@ void cLcd::Action(void) { // LCD output 
   
   voltime.tv_sec=0;
   for (i=0;i<LCDMAXSTATES;i++) for (j=0;j<4;j++) Lcddirty[i][j]=true;
-  time_t nextLcdUpdate = (time(NULL)/60)*60+60;
-
+  time_t nextLcdUpdate = 0; // trigger first update immediately
   while (true) { // main loop, wakes up every WakeUpCycle, any output to LCDd is done here  
     gettimeofday(&now,NULL);
 
     //  epg update
+  if (channelSwitched) {
+    channelSwitched = false;
+    nextLcdUpdate = 0; //trigger next epg update
+  }
 
 #ifdef OLDVDR
 
@@ -700,8 +704,6 @@ void cLcd::Action(void) { // LCD output 
       }
      if ( nextLcdUpdate <= time(NULL) )
          nextLcdUpdate=(time(NULL)/60)*60+60;
-      else if ( nextLcdUpdate > time(NULL)+60 )
-         nextLcdUpdate=(time(NULL)/60)*60+60;
     }
 
 #else
@@ -731,8 +733,6 @@ void cLcd::Action(void) { // LCD output 
       }
      if ( nextLcdUpdate <= time(NULL) )
          nextLcdUpdate=(time(NULL)/60)*60+60;
-      else if ( nextLcdUpdate > time(NULL)+60 )
-         nextLcdUpdate=(time(NULL)/60)*60+60;
     }  
 
 #endif
@@ -1023,4 +1023,8 @@ void cLcd::Action(void) { // LCD output 
     }
     usleep(WakeUpCycle-(now.tv_usec%WakeUpCycle)); // sync to systemtime for nicer time output 
   }
+}
+
+void cLcd::ChannelSwitched() {
+    channelSwitched = true;
 }
diff -rup lcdproc-0.0.10.sav/lcd.h lcdproc-0.0.10/lcd.h
--- lcdproc-0.0.10.sav/lcd.h	Wed Nov  9 22:01:59 2005
+++ lcdproc-0.0.10/lcd.h	Thu Jan  5 16:57:18 2006
@@ -57,6 +57,7 @@ class cLcd : public cThread {
     void PopThreadState();
     void SetReplayDevice(cControl *DvbApi);
     void SetPrimaryDevice(cDevice *DvbApi);
+    void ChannelSwitched(); //to propagate "ChannelSwitched"-Event from cLcdFeed to cLcd
   private:
     char *SummaryText;
     unsigned int SummaryTextL;
@@ -75,6 +76,7 @@ class cLcd : public cThread {
     void GetTimeDateStat( char *string, unsigned int OutStateData[] );
     void Action(void);
     int closing ;
+    bool channelSwitched;
 };
 
 #endif //__LCD_H
diff -rup lcdproc-0.0.10.sav/lcdproc.c lcdproc-0.0.10/lcdproc.c
--- lcdproc-0.0.10.sav/lcdproc.c	Wed Nov  9 22:01:59 2005
+++ lcdproc-0.0.10/lcdproc.c	Thu Jan  5 16:32:59 2006
@@ -73,6 +73,7 @@ void cLcdFeed::ChannelSwitch(const cDevi
       LCDproc->SetLine(1,2," "); 
       LCDproc->SetLine(1,3," ");
       LCDproc->SetRunning(false,tr("Waiting for EPG info."), NULL); 
+      LCDproc->ChannelSwitched();
       switched = true; 
     } else switched = false;
     LCDproc->SetPrimaryDevice( (cDevice *) Device );