Malcolm Caldwell wrote:
In case there's no older version of channels.conf, is there some simple sed/awk/perl script to remove the extra fields, or is it not strictly necessary? Is it just a 's/M2O0S0//' when you only have dvb-s channels?
Should be pretty much it.
Why not make 1.6.0 ignore this field so it can just work for people who upgrade/downgrade?
... that would be the attached patch. It just ignores the fields added by the temporary 1.5.14 format. When VDR saves the channels.conf next time, the format will be reverted to the 1.5.15 format, dropping the new fields. 1.5.14 and 1.7.x will re-add them anyway.
Cheers,
Udo
--- vdr-1.5.15/channels.c 2008-02-10 16:45:38.000000000 +0100 +++ vdr-1.5.15-patched/channels.c 2008-02-22 19:13:32.000000000 +0100 @@ -624,10 +624,24 @@ return NULL; }
+static const char *DropParseParameter(const char *s) +{ + if (*++s) { + char *p = NULL; + errno = 0; + strtol(s, &p, 10); + if (!errno && p != s) + return p; + } + esyslog("ERROR: invalid value for parameter '%c'", *(s - 1)); + return NULL; +} + bool cChannel::StringToParameters(const char *s) { while (s && *s) { switch (toupper(*s)) { + case 'A': s = DropParseParameter(s); break; case 'B': s = ParseParameter(s, bandwidth, BandwidthValues); break; case 'C': s = ParseParameter(s, coderateH, CoderateValues); break; case 'D': s = ParseParameter(s, coderateL, CoderateValues); break; @@ -636,7 +650,11 @@ case 'I': s = ParseParameter(s, inversion, InversionValues); break; case 'L': polarization = *s++; break; case 'M': s = ParseParameter(s, modulation, ModulationValues); break; + case 'Z': s = DropParseParameter(s); break; + case 'O': s = DropParseParameter(s); break; + case 'P': s = DropParseParameter(s); break; case 'R': polarization = *s++; break; + case 'S': s = DropParseParameter(s); break; case 'T': s = ParseParameter(s, transmission, TransmissionValues); break; case 'V': polarization = *s++; break; case 'Y': s = ParseParameter(s, hierarchy, HierarchyValues); break;