Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[vdr] Re: VDR developer version 1.3.7
On Sun, May 16, 2004 at 03:36:35PM +0200, Klaus Schmidinger wrote:
> VDR developer version 1.3.7 is now available at
>
> ftp://ftp.cadsoft.de/vdr/Developer/vdr-1.3.7.tar.bz2
[...]
... just to says it. IMHO the ``summary for huge number of recordings''
is missed. This one weas send some days her on this list and it is
really a great improvment.
Werner
--
AC3 loop through sound card http://bitstreamout.sourceforge.net/
Howto http://www.vdr-portal.de/board/thread.php?threadid=1958
------------------------------------------------------------------
"Having a smoking section in a restaurant is like having
a peeing section in a swimming pool." -- Edward Burr
--- recording.c
+++ recording.c Thu May 6 14:34:46 2004
@@ -358,6 +358,7 @@
if (*Subtitle || *Summary)
asprintf(&summary, "%s\n\n%s%s%s", Title, Subtitle, (*Subtitle && *Summary) ? "\n\n" : "", Summary);
}
+ readsummary = true;
}
cRecording::cRecording(const char *FileName)
@@ -371,6 +372,7 @@
name = NULL;
summary = NULL;
+ readsummary = false;
if (p) {
time_t now = time(NULL);
struct tm tm_r;
@@ -386,39 +388,6 @@
name[p - FileName] = 0;
name = ExchangeChars(name, false);
}
- // read an optional summary file:
- char *SummaryFileName = NULL;
- asprintf(&SummaryFileName, "%s%s", fileName, SUMMARYFILESUFFIX);
- int f = open(SummaryFileName, O_RDONLY);
- if (f >= 0) {
- struct stat buf;
- if (fstat(f, &buf) == 0) {
- int size = buf.st_size;
- summary = MALLOC(char, size + 1); // +1 for terminating 0
- if (summary) {
- int rbytes = safe_read(f, summary, size);
- if (rbytes >= 0) {
- summary[rbytes] = 0;
- if (rbytes != size)
- esyslog("%s: expected %d bytes but read %d", SummaryFileName, size, rbytes);
- }
- else {
- LOG_ERROR_STR(SummaryFileName);
- free(summary);
- summary = NULL;
- }
-
- }
- else
- esyslog("can't allocate %d byte of memory for summary file '%s'", size + 1, SummaryFileName);
- close(f);
- }
- else
- LOG_ERROR_STR(SummaryFileName);
- }
- else if (errno != ENOENT)
- LOG_ERROR_STR(SummaryFileName);
- free(SummaryFileName);
}
}
@@ -579,8 +548,50 @@
return titleBuffer;
}
+const char *cRecording::Summary(void)
+{
+ // read an optional summary file:
+ if (!readsummary) {
+ char *SummaryFileName = NULL;
+ asprintf(&SummaryFileName, "%s%s", fileName, SUMMARYFILESUFFIX);
+ int f = open(SummaryFileName, O_RDONLY);
+ if (f >= 0) {
+ struct stat buf;
+ if (fstat(f, &buf) == 0) {
+ int size = buf.st_size;
+ summary = MALLOC(char, size + 1); // +1 for terminating 0
+ if (summary) {
+ int rbytes = safe_read(f, summary, size);
+ if (rbytes >= 0) {
+ summary[rbytes] = 0;
+ if (rbytes != size)
+ esyslog("%s: expected %d bytes but read %d", SummaryFileName, size, rbytes);
+ }
+ else {
+ LOG_ERROR_STR(SummaryFileName);
+ free(summary);
+ summary = NULL;
+ }
+ }
+ else
+ esyslog("can't allocate %d byte of memory for summary file '%s'", size + 1, SummaryFileName);
+ close(f);
+ }
+ else
+ LOG_ERROR_STR(SummaryFileName);
+ }
+ else if (errno != ENOENT)
+ LOG_ERROR_STR(SummaryFileName);
+ free(SummaryFileName);
+ readsummary = true;
+ }
+ return summary;
+}
+
const char *cRecording::PrefixFileName(char Prefix)
{
+ if (!readsummary)
+ Summary();
const char *p = PrefixVideoFileName(FileName(), Prefix);
if (p) {
free(fileName);
--- recording.h
+++ recording.h Tue Apr 27 18:31:54 2004
@@ -40,6 +40,7 @@
char *fileName;
char *name;
char *summary;
+ bool readsummary;
char *StripEpisodeName(char *s);
char *SortName(void);
int GetResume(void);
@@ -54,7 +55,7 @@
const char *Name(void) { return name; }
const char *FileName(void);
const char *Title(char Delimiter = ' ', bool NewIndicator = false, int Level = -1);
- const char *Summary(void) { return summary; }
+ const char *Summary(void);
const char *PrefixFileName(char Prefix);
int HierarchyLevels(void);
bool IsNew(void) { return GetResume() <= 0; }
Home |
Main Index |
Thread Index