From b9bfba20f25a0562d22bb57d611abc3918e1c147 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 19 Feb 2006 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.3.43=20-=20Removed=20an=20unnecessary=20toF?= =?UTF-8?q?ile->SetReadAhead()=20from=20cutter.c=20(thanks=20to=20Artur=20?= =?UTF-8?q?=20=20Skawina).=20-=20The=20"Back"=20key=20now=20restores=20the?= =?UTF-8?q?=20original=20string=20when=20pressed=20while=20editing=20a=20?= =?UTF-8?q?=20=20string=20item=20(suggested=20by=20Markus=20Hahn).=20-=20N?= =?UTF-8?q?ow=20stopping=20scanning=20the=20video=20directory=20if=20there?= =?UTF-8?q?=20are=20too=20many=20levels=20of=20=20=20symbolic=20links,=20w?= =?UTF-8?q?hich=20might=20indicate=20a=20recursive=20link=20loop=20(based?= =?UTF-8?q?=20on=20a=20patch=20=20=20from=20Helmut=20Auer).=20-=20Improved?= =?UTF-8?q?=20OSD=20area=20handling=20in=20cDvbSpuDecoder=20(thanks=20to?= =?UTF-8?q?=20Marco=20Schl=C3=BC=C3=9Fler).=20-=20Now=20logging=20the=20de?= =?UTF-8?q?scription=20(if=20present)=20in=20case=20a=20thread=20is=20canc?= =?UTF-8?q?eled=20(suggested=20=20=20by=20Marco=20Schl=C3=BC=C3=9Fler).=20?= =?UTF-8?q?-=20cMenuText=20now=20uses=20the=20given=20font=20(thanks=20to?= =?UTF-8?q?=20Rolf=20Ahrenberg).=20-=20The=20ST:TNG=20skin=20now=20uses=20?= =?UTF-8?q?the=20fixed=20font=20if=20requested=20when=20displaying=20texts?= =?UTF-8?q?.=20-=20Fixed=20some=20typos=20in=20the=20CONTRIBUTORS=20file?= =?UTF-8?q?=20(thanks=20to=20Frank=20Kr=C3=B6mmelbein).=20-=20Changed=20of?= =?UTF-8?q?fset=20and=20size=20handling=20in=20'libsi'=20from=20'unsigned'?= =?UTF-8?q?=20to=20'signed',=20so=20that=20=20=20overflows=20can=20be=20be?= =?UTF-8?q?tter=20detected=20(thanks=20to=20Marcel=20Wiesweg).=20-=20Check?= =?UTF-8?q?ing=20data=20size=20in=20CaDescriptor::Parse()=20and=20LinkageD?= =?UTF-8?q?escriptor::Parse()=20of=20=20=20'libsi'=20to=20avoid=20crashes?= =?UTF-8?q?=20with=20invalid=20data=20(thanks=20to=20Marcel=20Wiesweg).=20?= =?UTF-8?q?-=20Made=20CharArray::DataOwnData::assign()=20in=20'libsi'=20mo?= =?UTF-8?q?re=20robust=20against=20invalid=20=20=20data=20(suggested=20by?= =?UTF-8?q?=20Oliver=20Endriss).=20Also=20changed=20CharArray::DataOwnData?= =?UTF-8?q?::Delete()=20=20=20so=20that=20it=20sets=20'size'=20and=20'data?= =?UTF-8?q?'=20to=200.=20-=20Now=20resetting=20the=20channel=20number=20if?= =?UTF-8?q?=20the=20number=20entered=20through=20the=20numeric=20keys=20?= =?UTF-8?q?=20=20exceeds=20the=20maximum=20channel=20number=20(thanks=20to?= =?UTF-8?q?=20Rolf=20Ahrenberg).=20-=20The=20language=20code=20in=20the=20?= =?UTF-8?q?'X'=20component=20records=20of=20EPG=20data=20can=20now=20consi?= =?UTF-8?q?st=20of=20=20=20two=20codes,=20separated=20by=20'+'.=20-=20If?= =?UTF-8?q?=20a=20recording=20starts=20and=20there=20is=20no=20EPG=20data?= =?UTF-8?q?=20available=20for=20the=20recorded=20channel,=20=20=20the=20'X?= =?UTF-8?q?'=20audio=20component=20records=20for=20the=20'info.vdr'=20file?= =?UTF-8?q?=20are=20now=20generated=20from=20the=20=20=20channel's=20PID?= =?UTF-8?q?=20data.=20-=20Externally=20provided=20EPG=20data=20(with=20tab?= =?UTF-8?q?le=20ID=200x00)=20now=20gets=20its=20component=20=20=20descript?= =?UTF-8?q?ors=20set=20from=20the=20broadcast=20data,=20so=20that=20langua?= =?UTF-8?q?ge=20codes=20and=20descriptions=20=20=20are=20available=20(sugg?= =?UTF-8?q?ested=20by=20Andreas=20Brugger).=20-=20When=20setting=20the=20a?= =?UTF-8?q?udio=20track=20descriptions,=20the=20language=20codes=20are=20n?= =?UTF-8?q?ow=20also=20set=20=20=20in=20case=20this=20is=20a=20replay=20se?= =?UTF-8?q?ssion=20(based=20on=20a=20patch=20from=20Rolf=20Ahrenberg).=20-?= =?UTF-8?q?=20If=20a=20recording=20starts=20and=20the=20channel's=20audio?= =?UTF-8?q?=20PID=20data=20has=20more=20language=20code=20=20=20informatio?= =?UTF-8?q?n=20than=20the=20EPG's=20component=20data,=20the=20code=20from?= =?UTF-8?q?=20the=20channel=20is=20taken.=20-=20Fixed=20handling=20DPID=20?= =?UTF-8?q?when=20deciding=20whether=20to=20switch=20to=20'Transfer=20Mode?= =?UTF-8?q?'=20(thanks=20=20=20to=20Marco=20Schl=C3=BC=C3=9Fler).=20-=20Fi?= =?UTF-8?q?xed=20replaying=20recordings=20of=20radio=20channels=20with=20m?= =?UTF-8?q?any=20audio=20tracks=20(thanks=20to=20=20=20Reinhard=20Nissl).?= =?UTF-8?q?=20-=20Added=20a=20comment=20to=20tChannelID::nid,=20explaining?= =?UTF-8?q?=20that=20is=20is=20actually=20the=20"original"=20=20=20network?= =?UTF-8?q?=20id.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- recording.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 12 deletions(-) (limited to 'recording.c') diff --git a/recording.c b/recording.c index e7efba0..1efa3f6 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.c 1.134 2006/02/05 12:34:08 kls Exp $ + * $Id: recording.c 1.137 2006/02/19 13:09:29 kls Exp $ */ #include "recording.h" @@ -58,6 +58,8 @@ #define MAX_SUBTITLE_LENGTH 40 +#define MAX_LINK_LEVEL 6 + bool VfatFileSystem = false; cRecordings DeletedRecordings(true); @@ -254,15 +256,44 @@ void cResumeFile::Delete(void) // --- cRecordingInfo -------------------------------------------------------- -cRecordingInfo::cRecordingInfo(tChannelID ChannelID, const cEvent *Event) -{ - channelID = ChannelID; - if (Event) { - event = Event; - ownEvent = NULL; +cRecordingInfo::cRecordingInfo(const cChannel *Channel, const cEvent *Event) +{ + channelID = Channel ? Channel->GetChannelID() : tChannelID::InvalidID; + ownEvent = Event ? NULL : new cEvent(0); + event = ownEvent ? ownEvent : Event; + if (Channel) { + // Since the EPG data's component records can carry only a single + // language code, let's see whether the channel's PID data has + // more information: + cComponents *Components = (cComponents *)event->Components(); + if (!Components) + Components = new cComponents; + for (int i = 0; i < MAXAPIDS; i++) { + const char *s = Channel->Alang(i); + if (*s) { + tComponent *Component = Components->GetComponent(i, 2, 3); + if (!Component) + Components->SetComponent(Components->NumComponents(), 2, 3, s, NULL); + else if (strlen(s) > strlen(Component->language)) + strn0cpy(Component->language, s, sizeof(Component->language)); + } + } + // There's no "multiple languages" for Dolby Digital tracks, but + // we do the same procedure here, too, in case there is no component + // information at all: + for (int i = 0; i < MAXDPIDS; i++) { + const char *s = Channel->Dlang(i); + if (*s) { + tComponent *Component = Components->GetComponent(i, 2, 5); + if (!Component) + Components->SetComponent(Components->NumComponents(), 2, 5, s, NULL); + else if (strlen(s) > strlen(Component->language)) + strn0cpy(Component->language, s, sizeof(Component->language)); + } + } + if (Components != event->Components()) + ((cEvent *)event)->SetComponents(Components); } - else - event = ownEvent = new cEvent(0); } cRecordingInfo::~cRecordingInfo() @@ -465,7 +496,7 @@ cRecording::cRecording(cTimer *Timer, const cEvent *Event) priority = Timer->Priority(); lifetime = Timer->Lifetime(); // handle info: - info = new cRecordingInfo(Timer->Channel()->GetChannelID(), Event); + info = new cRecordingInfo(Timer->Channel(), Event); // this is a somewhat ugly hack to get the 'summary' information from the // timer into the recording info, but it saves us from having to actually // copy the entire event data: @@ -811,7 +842,7 @@ void cRecordings::Refresh(bool Foreground) ScanVideoDir(VideoDirectory, Foreground); } -void cRecordings::ScanVideoDir(const char *DirName, bool Foreground) +void cRecordings::ScanVideoDir(const char *DirName, bool Foreground, int LinkLevel) { cReadDir d(DirName); struct dirent *e; @@ -821,7 +852,13 @@ void cRecordings::ScanVideoDir(const char *DirName, bool Foreground) asprintf(&buffer, "%s/%s", DirName, e->d_name); struct stat st; if (stat(buffer, &st) == 0) { + int Link = 0; if (S_ISLNK(st.st_mode)) { + if (LinkLevel > MAX_LINK_LEVEL) { + isyslog("max link level exceeded - not scanning %s", buffer); + continue; + } + Link = 1; char *old = buffer; buffer = ReadLink(old); free(old); @@ -849,7 +886,7 @@ void cRecordings::ScanVideoDir(const char *DirName, bool Foreground) delete r; } else - ScanVideoDir(buffer, Foreground); + ScanVideoDir(buffer, Foreground, LinkLevel + Link); } } free(buffer); -- cgit v1.2.3