summaryrefslogtreecommitdiff
path: root/eit.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-11-02 12:46:53 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2002-11-02 12:46:53 +0100
commitbc766ad04b8d344cd750cec74b8a0bc2300b8ef6 (patch)
treecee79d542917a881f0fba749fa8425db011df4d0 /eit.c
parent5dd0c65e3519c21f79b0e8f69df01c28223e6283 (diff)
downloadvdr-bc766ad04b8d344cd750cec74b8a0bc2300b8ef6.tar.gz
vdr-bc766ad04b8d344cd750cec74b8a0bc2300b8ef6.tar.bz2
Fixed reading EPG data via the SVDRP command PUTE
Diffstat (limited to 'eit.c')
-rw-r--r--eit.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/eit.c b/eit.c
index b608fc46..12045d63 100644
--- a/eit.c
+++ b/eit.c
@@ -16,7 +16,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
- * $Id: eit.c 1.58 2002/11/01 10:05:56 kls Exp $
+ * $Id: eit.c 1.59 2002/11/02 12:46:53 kls Exp $
***************************************************************************/
#include "eit.h"
@@ -753,7 +753,7 @@ bool cSchedule::Read(FILE *f, cSchedules *Schedules)
if (*s == 'C') {
unsigned int uServiceID;
if (1 == sscanf(s + 1, "%u", &uServiceID)) {
- cSchedule *p = (cSchedule *)Schedules->SetCurrentServiceID(uServiceID);
+ cSchedule *p = (cSchedule *)Schedules->AddServiceID(uServiceID);
if (p) {
if (!cEventInfo::Read(f, p))
return false;
@@ -782,20 +782,22 @@ cSchedules::~cSchedules()
{
}
/** */
+const cSchedule *cSchedules::AddServiceID(unsigned short servid)
+{
+ const cSchedule *p = GetSchedule(servid);
+ if (!p) {
+ Add(new cSchedule(servid));
+ p = GetSchedule(servid);
+ }
+ return p;
+}
+/** */
const cSchedule *cSchedules::SetCurrentServiceID(unsigned short servid)
{
- pCurrentSchedule = GetSchedule(servid);
- if (pCurrentSchedule == NULL)
- {
- Add(new cSchedule(servid));
- pCurrentSchedule = GetSchedule(servid);
- if (pCurrentSchedule == NULL)
- return NULL;
- }
-
- uCurrentServiceID = servid;
-
- return pCurrentSchedule;
+ pCurrentSchedule = AddServiceID(servid);
+ if (pCurrentSchedule)
+ uCurrentServiceID = servid;
+ return pCurrentSchedule;
}
/** */
const cSchedule * cSchedules::GetSchedule() const