summaryrefslogtreecommitdiff
path: root/recording.c
diff options
context:
space:
mode:
Diffstat (limited to 'recording.c')
-rw-r--r--recording.c11
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);