From af483c11aebd8146a978dba3d604bda0951e24ac Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 17 Oct 2004 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.3.13=20-=20Fixed=20checking=20for=20the=20p?= =?UTF-8?q?resence=20of=20NPTL=20(thanks=20to=20Jouni=20Karvo).=20-=20Maki?= =?UTF-8?q?ng=20sure=20section=20filters=20are=20only=20set=20if=20the=20d?= =?UTF-8?q?evice=20actually=20has=20a=20lock=20=20=20(thanks=20to=20Andrea?= =?UTF-8?q?s=20Share=20for=20pointing=20this=20out).=20-=20Fixed=20a=20pos?= =?UTF-8?q?sible=20NULL=20pointer=20assignment=20in=20cMenuText::SetText()?= =?UTF-8?q?=20(thanks=20to=20=20=20Marco=20Schl=C3=BCssler).=20-=20Fixed?= =?UTF-8?q?=20a=20crash=20in=20case=20the=20last=20line=20in=20channels.co?= =?UTF-8?q?nf=20is=20a=20group=20separator=20and=20=20=20that=20group=20is?= =?UTF-8?q?=20selected=20in=20the=20channel=20display=20(thanks=20to=20Dic?= =?UTF-8?q?k=20Streefland).=20-=20Added=20cRingBufferLinear::Read()=20to?= =?UTF-8?q?=20read=20directly=20from=20a=20file=20handle=20into=20the=20?= =?UTF-8?q?=20=20ring=20buffer.=20-=20Using=20timeouts=20in=20ring=20buffe?= =?UTF-8?q?rs=20to=20avoid=20'usleep()'.=20-=20Clearing=20the=20'Transfer?= =?UTF-8?q?=20Mode'=20ring=20buffer=20after=20clearing=20the=20device=20to?= =?UTF-8?q?=20avoid=20=20=20an=20"almost=20full"=20ring=20buffer.=20-=20Re?= =?UTF-8?q?moved=20locking=20from=20cRingBufferLinear=20for=20better=20per?= =?UTF-8?q?formance=20under=20high=20load.=20-=20Using=20a=20cRingBufferLi?= =?UTF-8?q?near=20in=20cRemux=20to=20avoid=20unnecessary=20copying=20of=20?= =?UTF-8?q?data.=20-=20Using=20a=20cRingBufferLinear=20in=20cTSBuffer=20an?= =?UTF-8?q?d=20filling=20it=20in=20a=20separate=20thread=20=20=20to=20avoi?= =?UTF-8?q?d=20buffer=20overflows.=20Plugins=20using=20cTSBuffer=20will=20?= =?UTF-8?q?need=20to=20remove=20the=20=20=20call=20to=20the=20now=20obsole?= =?UTF-8?q?te=20Read()=20function=20(see=20cDvbDevice::GetTSPacket()=20for?= =?UTF-8?q?=20=20=20the=20new=20usage=20of=20cTSBuffer).=20-=20cRemux::Pro?= =?UTF-8?q?cess()=20has=20been=20split=20into=20Put(),=20Get()=20and=20Del?= =?UTF-8?q?()=20to=20allow=20for=20a=20=20=20better=20decoupling=20of=20th?= =?UTF-8?q?e=20remuxing=20and=20disk=20writing=20process.=20Plugins=20usin?= =?UTF-8?q?g=20=20=20cRemux=20will=20need=20to=20be=20modified=20according?= =?UTF-8?q?ly.=20-=20The=20actual=20disk=20writing=20in=20recordings=20is?= =?UTF-8?q?=20now=20done=20in=20a=20separate=20thread=20to=20=20=20improve?= =?UTF-8?q?=20the=20overall=20throughput.=20-=20Changed=20cRemux=20so=20th?= =?UTF-8?q?at=20it=20returns=20the=20maximum=20available=20amount=20of=20d?= =?UTF-8?q?ata=20with=20=20=20each=20call,=20not=20just=202048=20byte.=20-?= =?UTF-8?q?=20Added=20a=20visual=20display=20of=20all=20cRingBufferLinear?= =?UTF-8?q?=20buffers=20for=20debugging.=20To=20=20=20activate=20it,=20def?= =?UTF-8?q?ine=20DEBUGRINGBUFFERS=20in=20ringbuffer.h.=20-=20Instead=20of?= =?UTF-8?q?=20cCondVar=20now=20using=20the=20new=20cCondWait=20(which=20al?= =?UTF-8?q?so=20avoids=20a=20possible=20=20=20"near=20miss"=20condition;?= =?UTF-8?q?=20thanks=20to=20Sascha=20Volkenandt=20for=20pointing=20out=20t?= =?UTF-8?q?his=20one).=20=20=20cCondVar=20is=20still=20present=20for=20plu?= =?UTF-8?q?gins=20that=20use=20it=20(and=20VDR=20itself=20also=20still=20?= =?UTF-8?q?=20=20uses=20it=20in=20cRemote).=20-=20The=20cRingBuffer=20now?= =?UTF-8?q?=20does=20EnableGet()/EnablePut()=20only=20if=20the=20buffer=20?= =?UTF-8?q?is=20more=20than=20=20=20one=20third=20full=20or=20empty,=20res?= =?UTF-8?q?pectively.=20This=20dramatically=20improves=20recording=20=20?= =?UTF-8?q?=20performance=20and=20reduces=20system=20load=20(thanks=20to?= =?UTF-8?q?=20Marco=20Schl=C3=BC=C3=9Fler=20for=20doing=20some=20=20=20tes?= =?UTF-8?q?ting=20regarding=20buffer=20performance=20and=20giving=20me=20s?= =?UTF-8?q?ome=20hints=20that=20finally=20led=20=20=20to=20finding=20out?= =?UTF-8?q?=20that=20this=20was=20the=20basic=20problem=20causing=20buffer?= =?UTF-8?q?=20overflows).=20-=20Improved=20Transfer=20Mode=20(thanks=20to?= =?UTF-8?q?=20Marco=20Schl=C3=BC=C3=9Fler=20for=20suggestions=20and=20test?= =?UTF-8?q?ing).=20-=20Fixed=20a=20possible=20crash=20with=20inconsistent?= =?UTF-8?q?=20SI=20data=20(thanks=20to=20Marcel=20Wiesweg).=20-=20Fixed=20?= =?UTF-8?q?showing=20the=20replay=20mode=20if=20the=20OSD=20is=20currently?= =?UTF-8?q?=20in=20use=20(thanks=20to=20Kimmo=20=20=20Tykkala=20for=20poin?= =?UTF-8?q?ting=20out=20this=20problem).=20-=20cOsdProvider::NewOsd()=20no?= =?UTF-8?q?w=20always=20returns=20a=20valid=20pointer,=20even=20if=20the?= =?UTF-8?q?=20OSD=20is=20=20=20currently=20in=20use=20(it=20will=20then=20?= =?UTF-8?q?return=20a=20dummy=20cOsd=20object=20and=20write=20a=20message?= =?UTF-8?q?=20to=20=20=20the=20log=20file).=20-=20Added=20Estonian=20langu?= =?UTF-8?q?age=20texts=20(thanks=20to=20Arthur=20Konovalov).=20-=20Fixed?= =?UTF-8?q?=20'newplugin'=20and=20libsi/Makefile=20to=20use=20the=20compil?= =?UTF-8?q?er=20defined=20in=20$(CXX)=20for=20=20=20generating=20file=20de?= =?UTF-8?q?pendencies=20(thanks=20to=20Andreas=20Brachold).=20-=20Moved=20?= =?UTF-8?q?the=20initialization=20of=20aPid1=20and=20aPid2=20to=20the=20be?= =?UTF-8?q?ginning=20of=20cDvbDevice::cDvbDevice()=20=20=20to=20have=20the?= =?UTF-8?q?m=20set=20in=20case=20a=20patch=20references=20them=20(thanks?= =?UTF-8?q?=20to=20Wayne=20Keer=20for=20pointing=20=20=20this=20out).=20-?= =?UTF-8?q?=20Completed=20the=20Russian=20OSD=20texts=20(thanks=20to=20Vya?= =?UTF-8?q?cheslav=20Dikonov).=20-=20Avoiding=20unnecessary=20section=20fi?= =?UTF-8?q?lter=20start/stops=20(thanks=20to=20Marco=20Schl=C3=BC=C3=9Fler?= =?UTF-8?q?).=20-=20Made=20the=20"Channel=20not=20available!"=20message=20?= =?UTF-8?q?and=20mtInfo=20instead=20of=20mtError=20(suggested=20=20=20by?= =?UTF-8?q?=20Wayne=20Keer).=20-=20Made=20volume=20control=20more=20linear?= =?UTF-8?q?=20(thanks=20to=20Emil=20Naepflein=20and=20Udo=20Richter).=20-?= =?UTF-8?q?=20Now=20skipping=20code=20table=20info=20in=20SI=20data=20(sug?= =?UTF-8?q?gested=20by=20Milos=20Kapoun).=20-=20Added=20missing=20Czech=20?= =?UTF-8?q?characters=20to=20fontosd-iso8859-2.c=20(thanks=20to=20Milos=20?= =?UTF-8?q?Kapoun).=20-=20Fixed=20a=20crash=20in=20the=20time=20search=20m?= =?UTF-8?q?echanism=20(reported=20by=20Reinhard=20Nissl).=20-=20If=20one?= =?UTF-8?q?=20PID=20can't=20be=20added,=20the=20whole=20cDevice::AttachRec?= =?UTF-8?q?eiver()=20will=20now=20fail=20=20=20and=20all=20PIDs=20added=20?= =?UTF-8?q?so=20far=20will=20be=20deleted=20(thanks=20to=20Marco=20Schl?= =?UTF-8?q?=C3=BC=C3=9Fler=20for=20=20=20pointing=20out=20this=20one).=20-?= =?UTF-8?q?=20Now=20only=20saving=20channels.conf=20after=20a=20modificati?= =?UTF-8?q?on=20made=20by=20the=20user=20(avoids=20=20=20lots=20of=20disk?= =?UTF-8?q?=20access=20due=20to=20automatic=20channel=20updates).=20Automa?= =?UTF-8?q?tic=20channel=20=20=20modifications=20will=20be=20saved=20every?= =?UTF-8?q?=2010=20minutes=20if=20no=20recording=20is=20currently=20=20=20?= =?UTF-8?q?active.=20-=20Removed=20the=20'Log'=20parameter=20from=20the=20?= =?UTF-8?q?cChannel::Set...=20functions.=20Instead=20=20=20checking=20if?= =?UTF-8?q?=20the=20channel=20has=20a=20non-zero=20number.=20-=20Updated?= =?UTF-8?q?=20'channels.conf.terr'=20for=20Hannover=20(thanks=20to=20Sven?= =?UTF-8?q?=20Kreiensen).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vdr.c | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'vdr.c') diff --git a/vdr.c b/vdr.c index fc1f9e0..6d76f17 100644 --- a/vdr.c +++ b/vdr.c @@ -22,7 +22,7 @@ * * The project's page is at http://www.cadsoft.de/vdr * - * $Id: vdr.c 1.184 2004/06/13 13:52:09 kls Exp $ + * $Id: vdr.c 1.187 2004/10/17 11:50:21 kls Exp $ */ #include @@ -58,10 +58,11 @@ #include "transfer.h" #include "videodir.h" -#define MINCHANNELWAIT 10 // seconds to wait between failed channel switchings -#define ACTIVITYTIMEOUT 60 // seconds before starting housekeeping -#define SHUTDOWNWAIT 300 // seconds to wait in user prompt before automatic shutdown -#define MANUALSTART 600 // seconds the next timer must be in the future to assume manual start +#define MINCHANNELWAIT 10 // seconds to wait between failed channel switchings +#define ACTIVITYTIMEOUT 60 // seconds before starting housekeeping +#define SHUTDOWNWAIT 300 // seconds to wait in user prompt before automatic shutdown +#define MANUALSTART 600 // seconds the next timer must be in the future to assume manual start +#define CHANNELSAVEDELTA 600 // seconds before saving channels.conf after automatic modifications static int Interrupted = 0; @@ -87,7 +88,7 @@ int main(int argc, char *argv[]) #ifdef _CS_GNU_LIBPTHREAD_VERSION // Check for NPTL and exit if present - VDR apparently doesn't run well with NPTL: char LibPthreadVersion[128]; - if (confstr(_CS_GNU_LIBPTHREAD_VERSION, LibPthreadVersion, sizeof(LibPthreadVersion) > 0)) { + if (confstr(_CS_GNU_LIBPTHREAD_VERSION, LibPthreadVersion, sizeof(LibPthreadVersion)) > 0) { if (strstr(LibPthreadVersion, "NPTL")) { fprintf(stderr, "vdr: please turn off NPTL by setting 'export LD_ASSUME_KERNEL=2.4.1' before starting VDR\n"); return 2; @@ -516,6 +517,9 @@ int main(int argc, char *argv[]) esyslog("emergency exit requested - shutting down"); break; } +#ifdef DEBUGRINGBUFFERS + cRingBufferLinear::PrintDebugRBL(); +#endif // Attach launched player control: cControl::Attach(); // Make sure we have a visible programme in case device usage has changed: @@ -543,10 +547,20 @@ int main(int argc, char *argv[]) } } // Handle channel modifications: - if (!Channels.BeingEdited() && Channels.Modified()) { - if (Channels.Lock(false, 100)) { - Channels.Save(); //XXX only after user changes??? - Timers.Save(); + if (!Channels.BeingEdited()) { + int modified = Channels.Modified(); + static time_t ChannelSaveTimeout = 0; + if (modified == CHANNELSMOD_USER) + ChannelSaveTimeout = 1; // triggers an immediate save + else if (modified && !ChannelSaveTimeout) + ChannelSaveTimeout = time(NULL) + CHANNELSAVEDELTA; + bool timeout = ChannelSaveTimeout == 1 || ChannelSaveTimeout && time(NULL) > ChannelSaveTimeout && !cRecordControls::Active(); + if ((modified || timeout) && Channels.Lock(false, 100)) { + if (timeout) { + Channels.Save(); + Timers.Save(); + ChannelSaveTimeout = 0; + } for (cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) { if (Channel->Modification(CHANNELMOD_RETUNE)) { cRecordControls::ChannelDataModified(Channel); -- cgit v1.2.3