From ed643353b100bee75459c4ef2d0330e7a04e1f2a Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 16 Aug 2002 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.1.7=20-=20Adapted=20VDR=20to=20the=20NEWSTR?= =?UTF-8?q?UCT=20driver.=20To=20use=20the=20new=20driver,=20compile=20VDR?= =?UTF-8?q?=20with=20=20=20'make=20NEWSTRUCT=3D1'=20(thanks=20to=20Holger?= =?UTF-8?q?=20W=C3=A4chtler=20for=20some=20valuable=20advice).=20=20=20By?= =?UTF-8?q?=20default=20it=20currently=20still=20uses=20the=20old=20driver?= =?UTF-8?q?.=20-=20Added=20some=20missing=20#includes=20(thanks=20to=20Mar?= =?UTF-8?q?tin=20Hammerschmid).=20-=20Changed=20the=20log=20error=20messag?= =?UTF-8?q?e=20"can't=20record=20MPEG1!"=20to=20"error=20in=20data=20strea?= =?UTF-8?q?m!",=20=20=20since=20the=20mentioning=20of=20MPEG1=20has=20irri?= =?UTF-8?q?tated=20many=20people.=20-=20Consistently=20using=20malloc/free?= =?UTF-8?q?=20and=20new/delete=20(thanks=20to=20Andreas=20Schultz).=20-=20?= =?UTF-8?q?Temporarily=20made=20cDevice::ProvidesCa()=20virtual=20(Andreas?= =?UTF-8?q?=20Schultz=20needs=20this=20=20=20in=20his=20DXR3=20plugin).=20?= =?UTF-8?q?-=20cDevice=20no=20longer=20exposes=20a=20file=20handle=20to=20?= =?UTF-8?q?cPlayer.=20A=20derived=20cPlayer=20class=20=20=20can=20now=20ca?= =?UTF-8?q?ll=20DevicePoll()=20to=20see=20whether=20the=20replay=20device?= =?UTF-8?q?=20is=20ready=20for=20=20=20further=20data.=20A=20derived=20cDe?= =?UTF-8?q?vice=20class=20must=20implement=20Poll()=20and=20shall=20=20=20?= =?UTF-8?q?check=20if=20any=20of=20its=20file=20handles=20is=20ready=20for?= =?UTF-8?q?=20data.=20-=20Implemented=20several=20replay=20modes=20to=20al?= =?UTF-8?q?low=20players=20that=20play=20only=20audio=20(thanks=20=20=20to?= =?UTF-8?q?=20Stefan=20Huelswitt).=20-=20Improved=20cCondVar::Wait()=20and?= =?UTF-8?q?=20implemented=20cCondVar::TimedWait()=20(thanks=20to=20=20=20S?= =?UTF-8?q?tefan=20Huelswitt).=20-=20VDR=20no=20longer=20gives=20up=20if?= =?UTF-8?q?=20there=20is=20no=20DVB=20device.=20It=20continues=20to=20work?= =?UTF-8?q?=20if=20=20=20there=20is=20at=20least=20one=20device,=20either?= =?UTF-8?q?=20a=20DVB=20device=20found=20by=20the=20core=20VDR=20code=20?= =?UTF-8?q?=20=20itself,=20or=20a=20device=20implemented=20by=20a=20plugin?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'config.c') diff --git a/config.c b/config.c index 376985f..5929b50 100644 --- a/config.c +++ b/config.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.c 1.103 2002/08/04 12:03:11 kls Exp $ + * $Id: config.c 1.104 2002/08/11 11:35:18 kls Exp $ */ #include "config.h" @@ -217,7 +217,7 @@ const char *cChannel::ToText(cChannel *Channel) s = strcpy(buf, s); strreplace(s, ':', '|'); } - delete buffer; + free(buffer); if (Channel->groupSep) asprintf(&buffer, ":%s\n", s); else { @@ -267,7 +267,7 @@ bool cChannel::Parse(const char *s) sscanf(apidbuf, "%d ,%d ", &apid1, &apid2); if (p) sscanf(p, "%d ,%d ", &dpid1, &dpid2); - delete apidbuf; + free(apidbuf); } else return false; @@ -279,7 +279,7 @@ bool cChannel::Parse(const char *s) tpid = 0; } strn0cpy(name, buffer, MaxChannelName); - delete buffer; + free(buffer); } else return false; @@ -377,7 +377,7 @@ cTimer::cTimer(const cEventInfo *EventInfo) cTimer::~cTimer() { - delete summary; + free(summary); } cTimer& cTimer::operator= (const cTimer &Timer) @@ -398,7 +398,7 @@ bool cTimer::operator< (const cListObject &ListObject) const char *cTimer::ToText(cTimer *Timer) { - delete buffer; + free(buffer); strreplace(Timer->file, ':', '|'); strreplace(Timer->summary, '\n', '|'); asprintf(&buffer, "%d:%d:%s:%04d:%04d:%d:%d:%s:%s\n", Timer->active, Timer->channel, PrintDay(Timer->day, Timer->firstday), Timer->start, Timer->stop, Timer->priority, Timer->lifetime, Timer->file, Timer->summary ? Timer->summary : ""); @@ -495,7 +495,7 @@ bool cTimer::Parse(const char *s) { char *buffer1 = NULL; char *buffer2 = NULL; - delete summary; + free(summary); summary = NULL; //XXX Apparently sscanf() doesn't work correctly if the last %a argument //XXX results in an empty string (this first occured when the EIT gathering @@ -508,13 +508,13 @@ bool cTimer::Parse(const char *s) while (l2 > 0 && isspace(s[l2 - 1])) l2--; if (s[l2 - 1] == ':') { - s2 = (char *)malloc(l2 + 3); + s2 = MALLOC(char, l2 + 3); strcat(strn0cpy(s2, s, l2 + 1), " \n"); s = s2; } if (8 <= sscanf(s, "%d :%d :%a[^:]:%d :%d :%d :%d :%a[^:\n]:%a[^\n]", &active, &channel, &buffer1, &start, &stop, &priority, &lifetime, &buffer2, &summary)) { if (summary && !*skipspace(summary)) { - delete summary; + free(summary); summary = NULL; } //TODO add more plausibility checks @@ -522,12 +522,12 @@ bool cTimer::Parse(const char *s) strn0cpy(file, buffer2, MaxFileName); strreplace(file, '|', ':'); strreplace(summary, '|', '\n'); - delete buffer1; - delete buffer2; - delete s2; + free(buffer1); + free(buffer2); + free(s2); return day != 0; } - delete s2; + free(s2); return false; } @@ -661,8 +661,8 @@ cCommand::cCommand(void) cCommand::~cCommand() { - delete title; - delete command; + free(title); + free(command); } bool cCommand::Parse(const char *s) @@ -685,7 +685,7 @@ bool cCommand::Parse(const char *s) const char *cCommand::Execute(void) { dsyslog("executing command '%s'", command); - delete result; + free(result); result = NULL; FILE *p = popen(command, "r"); if (p) { @@ -749,7 +749,7 @@ cCaDefinition::cCaDefinition(void) cCaDefinition::~cCaDefinition() { - delete description; + free(description); } bool cCaDefinition::Parse(const char *s) @@ -935,9 +935,9 @@ cSetupLine::cSetupLine(const char *Name, const char *Value, const char *Plugin) cSetupLine::~cSetupLine() { - delete plugin; - delete name; - delete value; + free(plugin); + free(name); + free(value); } bool cSetupLine::operator< (const cListObject &ListObject) @@ -1068,7 +1068,7 @@ void cSetup::Store(const char *Name, int Value, const char *Plugin) char *buffer = NULL; asprintf(&buffer, "%d", Value); Store(Name, buffer, Plugin); - delete buffer; + free(buffer); } bool cSetup::Load(const char *FileName) -- cgit v1.2.3