#! /bin/sh /usr/share/dpatch/dpatch-run ## 01_fixnoepg+compat.dpatch by Thomas Günther ## http://toms-cafe.de/vdr/download/tvonscreen-0.7.0-fixnoepg+compat.diff ## ## Contains following patches: ## - http://toms-cafe.de/vdr/download/tvonscreen-0.7.0-fix-noepg.diff ## (fixes segmentation fault without any epg data) ## - http://vdrportal.de/board/thread.php?postid=246219#post246219 ## (changes for VDR >= 1.3.18) ## added compatibility to VDR < 1.3.18 ## - http://toms-cafe.de/vdr/download/tvonscreen-1.3.31.diff ## (changes for VDR >= 1.3.31) ## - http://vdrportal.de/board/thread.php?postid=401733#post401733 ## (fixes segmentation fault with empty columns) ## - Makefile-fPIC-fix ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Fixes segmentation fault without any epg data. Changes for VDR >= 1.3.18. ## DP: Changes for VDR >= 1.3.31. Adds -fPIC to Makefile to fix potential FTBFS. @DPATCH@ --- tvonscreen-0.7.0/Makefile +++ tvonscreen-0.7.0/Makefile @@ -16,7 +16,7 @@ ### The C++ compiler and options: CXX ?= g++ -CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual +CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual ### The directory environment: --- tvonscreen-0.7.0/gfxtools.c +++ tvonscreen-0.7.0/gfxtools.c @@ -7,6 +7,7 @@ * */ +#include #include #include "gfxtools.h" #include @@ -24,7 +25,12 @@ int index = 0; char *s; +#if VDRVERSNUM >= 10318 + cReadLine ReadLine; + while ( (s = ReadLine.Read(f) ) != NULL ) +#else while ((s = readline(f)) != NULL) +#endif { s = skipspace(s); if (!isXpm) --- tvonscreen-0.7.0/magazine.c +++ tvonscreen-0.7.0/magazine.c @@ -475,7 +475,12 @@ #endif int j=0; +#if VDRVERSNUM >= 10318 + const char *txt; + cString timetxt; +#else const char *txt,*timetxt; +#endif int lh=-1; int lhc=0; #if VDRVERSNUM >= 10307 @@ -539,7 +544,11 @@ col=clrYellow; EDIT_curEVI=i; } +#if VDRVERSNUM >= 10318 + timetxt=*cev->GetTimeString(); +#else timetxt=cev->GetTimeString(); +#endif #if VDRVERSNUM >= 10300 txt=cev->Title(); #else @@ -642,6 +651,9 @@ const cEventInfo *magazine::getNext(const cSchedule *s,const cEventInfo *e) #endif { + if (e == NULL) + return NULL; + #if VDRVERSNUM >= 10300 const cEvent *pe = NULL; time_t ref = e->StartTime(); @@ -686,6 +698,9 @@ const cEventInfo *magazine::getPrev(const cSchedule *s,const cEventInfo *e) #endif { + if (e == NULL) + return NULL; + #if VDRVERSNUM >= 10300 const cEvent *pe = NULL; time_t ref = e->StartTime(); @@ -1484,9 +1499,9 @@ { state = cOsdObject::ProcessKey(Key); - if (state == osUnknown) + if (state == osUnknown && schedArrayNum>currentFirst) { - if (curmode==SHOW && schedArrayNum>currentFirst) + if (curmode==SHOW) { switch (Key & ~k_Repeat) { @@ -1522,6 +1537,8 @@ currentFirst++; if (currentFirst>schedArrayNum-3) currentFirst=schedArrayNum-3; + if (currentFirst<0) + currentFirst=0; output(); break; case kUp: @@ -1556,6 +1573,8 @@ currentFirst+=3; if (currentFirst>schedArrayNum-3) currentFirst=schedArrayNum-3; + if (currentFirst<0) + currentFirst=0; output(); break; case k8: // zum aktuellen Sender @@ -1621,18 +1640,21 @@ { case kOk: { - delete osd; - osd=NULL; #if VDRVERSNUM >= 10300 cEvent **ev=ev4ch(EDIT_curChannel); #else cEventInfo **ev=ev4ch(EDIT_curChannel); #endif - me=new tvOcMenuEvent(ev[EDIT_curEVI]); - me->Display(); - curmode=SHOW; - EDIT_curEvent=0; - return osContinue; + if (ev[EDIT_curEVI] != NULL) + { + delete osd; + osd=NULL; + me=new tvOcMenuEvent(ev[EDIT_curEVI]); + me->Display(); + curmode=SHOW; + EDIT_curEvent=0; + return osContinue; + } } break; case kBack: @@ -1657,11 +1679,15 @@ EDIT_curChannel++; if (EDIT_curChannel>schedArrayNum-1) EDIT_curChannel=schedArrayNum-1; + if (EDIT_curChannel<0) + EDIT_curChannel=0; if (EDIT_curChannel>currentFirst+2) { currentFirst++; if (currentFirst>schedArrayNum-3) currentFirst=schedArrayNum-3; + if (currentFirst<0) + currentFirst=0; EDIT_curChannel=currentFirst+2; } outputLR(); @@ -1788,21 +1814,24 @@ break; */ case kRecord: { - delete osd; - osd=NULL; #if VDRVERSNUM >= 10300 cEvent **ev=ev4ch(EDIT_curChannel); #else cEventInfo **ev=ev4ch(EDIT_curChannel); #endif - cTimer *timer = new cTimer(ev[EDIT_curEVI]); - cTimer *t = Timers.GetTimer(timer); - if (t) + if (ev[EDIT_curEVI] != NULL) { - delete timer; - timer = t; + delete osd; + osd=NULL; + cTimer *timer = new cTimer(ev[EDIT_curEVI]); + cTimer *t = Timers.GetTimer(timer); + if (t) + { + delete timer; + timer = t; + } + met=new cMenuEditTimer(timer, !t); } - met=new cMenuEditTimer(timer, !t); } break; default: --- tvonscreen-0.7.0/search.c +++ tvonscreen-0.7.0/search.c @@ -17,7 +17,12 @@ #endif { char buf[200]; +#if VDRVERSNUM >= 10318 + const char *txt,*chan; + cString time1,time2,date; +#else const char *txt,*time1,*time2,*date,*chan; +#endif cChannel *channel; myev=ev; @@ -26,9 +31,16 @@ #else channel = Channels.GetByChannelID(ev->GetChannelID(), true); #endif +#if VDRVERSNUM >= 10318 + time1=*ev->GetTimeString(); + time2=*ev->GetEndTimeString(); +#else time1=ev->GetTimeString(); time2=ev->GetEndTimeString(); -#if VDRVERSNUM >= 10308 +#endif +#if VDRVERSNUM >= 10318 + date=*ev->GetDateString(); +#elif VDRVERSNUM >= 10308 date=ev->GetDateString(); #else date=ev->GetDate(); @@ -44,7 +56,11 @@ txt=ev->GetTitle(); #endif +#if VDRVERSNUM >= 10318 + snprintf(buf,sizeof(buf)-1,"%.6s %s - %s %s/%s",*date,*time1,*time2,chan,txt); +#else snprintf(buf,sizeof(buf)-1,"%.6s %s - %s %s/%s",date,time1,time2,chan,txt); +#endif SetText(buf); } --- tvonscreen-0.7.0/timer.h +++ tvonscreen-0.7.0/timer.h @@ -11,10 +11,12 @@ #define TIMER_H #include +#include #include #include "gfxtools.h" #include "config.h" +#if VDRVERSNUM < 10331 #if VDRVERSNUM >= 10300 class cMenuEvent : public cOsdMenu { private: @@ -48,6 +50,7 @@ virtual ~cMenuEditTimer(); virtual eOSState ProcessKey(eKeys Key); }; +#endif class tvOcMenuEvent : public cMenuEvent { public: