diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2007-06-17 13:13:47 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2007-06-17 13:13:47 +0200 |
commit | da376c060349470a5c54753f66bb0305746b8f78 (patch) | |
tree | 0a4243bd413819ce1a075982c839a596fb75011a /recording.c | |
parent | efbb48dbaf648caccd0a7591558252f8e00f0071 (diff) | |
download | vdr-da376c060349470a5c54753f66bb0305746b8f78.tar.gz vdr-da376c060349470a5c54753f66bb0305746b8f78.tar.bz2 |
The info.vdr file now also stores the name of the channel
Diffstat (limited to 'recording.c')
-rw-r--r-- | recording.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/recording.c b/recording.c index f2a617f2..22bb9556 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.153 2007/06/16 09:36:08 kls Exp $ + * $Id: recording.c 1.154 2007/06/17 13:10:12 kls Exp $ */ #include "recording.h" @@ -262,6 +262,7 @@ void cResumeFile::Delete(void) cRecordingInfo::cRecordingInfo(const cChannel *Channel, const cEvent *Event) { channelID = Channel ? Channel->GetChannelID() : tChannelID::InvalidID; + channelName = Channel ? strdup(Channel->Name()) : NULL; ownEvent = Event ? NULL : new cEvent(0); event = ownEvent ? ownEvent : Event; aux = NULL; @@ -304,6 +305,7 @@ cRecordingInfo::~cRecordingInfo() { delete ownEvent; free(aux); + free(channelName); } void cRecordingInfo::SetData(const char *Title, const char *ShortText, const char *Description) @@ -334,8 +336,11 @@ bool cRecordingInfo::Read(FILE *f) switch (*s) { case 'C': { char *p = strchr(t, ' '); - if (p) + if (p) { + free(channelName); + asprintf(&channelName, "%s", compactspace(p)); *p = 0; // strips optional channel name + } if (*t) channelID = tChannelID::FromString(t); } @@ -375,7 +380,7 @@ bool cRecordingInfo::Read(FILE *f) bool cRecordingInfo::Write(FILE *f, const char *Prefix) const { if (channelID.Valid()) - fprintf(f, "%sC %s\n", Prefix, *channelID.ToString()); + fprintf(f, "%sC %s%s%s\n", Prefix, *channelID.ToString(), channelName ? " " : "", channelName ? channelName : ""); event->Dump(f, Prefix, true); if (aux) fprintf(f, "%s@ %s\n", Prefix, aux); |