summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2014-03-09 12:15:08 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2014-03-09 12:15:08 +0100
commite823560ec53c7209f278fa331b2c0d227ca5529e (patch)
tree9584f6105f7938eb3474f23c8fe4552c06c43dbb
parentff1422a75a753789633f48c01726324107a237e6 (diff)
downloadvdr-e823560ec53c7209f278fa331b2c0d227ca5529e.tar.gz
vdr-e823560ec53c7209f278fa331b2c0d227ca5529e.tar.bz2
Fixed adding new source types in case they are already registered
-rw-r--r--CONTRIBUTORS2
-rw-r--r--HISTORY4
-rw-r--r--sourceparams.c6
-rw-r--r--sources.c11
-rw-r--r--sources.h3
5 files changed, 20 insertions, 6 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index ad968731..ee4e81c4 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -1176,6 +1176,8 @@ Rolf Ahrenberg <Rolf.Ahrenberg@sci.fi>
for a patch that was used to rename the "plp id" to a more general "stream id"
and add support for DVB-S2 "Input Stream Identifier" (ISI)
for fixing clearing non-editable members in the channel editor
+ for reporting a problem with adding new source types in case they are already
+ registered
Ralf Klueber <ralf.klueber@vodafone.com>
for reporting a bug in cutting a recording if there is only a single editing mark
diff --git a/HISTORY b/HISTORY
index ef1cd6c0..78821829 100644
--- a/HISTORY
+++ b/HISTORY
@@ -7870,7 +7870,7 @@ Video Disk Recorder Revision History
and also to use the correct directory with --edit (the latter reported by Marko
Mäkelä).
-2014-03-08: Version 2.0.6
+2014-03-09: Version 2.0.6
- Updated 'sources.conf' (thanks to Antti Hartikainen).
- cFont::CreateFont() now returns a dummy font in case there are no fonts installed.
@@ -7904,3 +7904,5 @@ Video Disk Recorder Revision History
on some HD channels to get stuck and resulted in buffer overflows.
- Fixed handling PAT packets when detecting frames, so that they can be properly
taken into account when regenerating the index of a recording.
+- Fixed adding new source types in case they are already registered (reported by Rolf
+ Ahrenberg).
diff --git a/sourceparams.c b/sourceparams.c
index 04317895..6d85f86c 100644
--- a/sourceparams.c
+++ b/sourceparams.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: sourceparams.c 1.2 2010/03/06 11:13:39 kls Exp $
+ * $Id: sourceparams.c 1.2.1.1 2014/03/09 12:13:18 kls Exp $
*/
#include "sourceparams.h"
@@ -21,8 +21,8 @@ cSourceParam::cSourceParam(char Source, const char *Description)
return;
}
SourceParams.Add(this);
- if (!strchr("ACST", Source)) // no, it's not "ATSC" ;-)
- Sources.Add(new cSource(Source, Description));
+ if (!Sources.ContainsSourceType(source))
+ Sources.Add(new cSource(source, Description));
dsyslog("registered source parameters for '%c - %s'", source, Description);
}
else
diff --git a/sources.c b/sources.c
index 44bf7d07..20c43044 100644
--- a/sources.c
+++ b/sources.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: sources.c 2.2 2010/02/28 15:15:39 kls Exp $
+ * $Id: sources.c 2.2.1.1 2014/03/09 12:13:25 kls Exp $
*/
#include "sources.h"
@@ -112,3 +112,12 @@ cSource *cSources::Get(int Code)
}
return NULL;
}
+
+bool cSources::ContainsSourceType(char SourceType)
+{
+ for (cSource *p = First(); p; p = Next(p)) {
+ if (cSource::ToChar(p->Code()) == SourceType)
+ return true;
+ }
+ return false;
+}
diff --git a/sources.h b/sources.h
index 516a3edc..c83ec59f 100644
--- a/sources.h
+++ b/sources.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: sources.h 2.4 2012/06/17 11:19:23 kls Exp $
+ * $Id: sources.h 2.4.1.1 2014/03/09 12:13:34 kls Exp $
*/
#ifndef __SOURCES_H
@@ -47,6 +47,7 @@ public:
class cSources : public cConfig<cSource> {
public:
cSource *Get(int Code);
+ bool ContainsSourceType(char SourceType);
};
extern cSources Sources;