From patchwork Fri Feb 22 18:38:45 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Udo Richter X-Patchwork-Id: 12604 Received: from mail.gmx.net ([213.165.64.20]) by www.linuxtv.org with smtp (Exim 4.63) (envelope-from ) id 1JSco8-0005xR-Se for vdr@linuxtv.org; Fri, 22 Feb 2008 19:39:40 +0100 Received: (qmail invoked by alias); 22 Feb 2008 18:39:07 -0000 Received: from Waff0.w.pppool.de (EHLO localhost) [89.58.175.240] by mail.gmx.net (mp020) with SMTP; 22 Feb 2008 19:39:07 +0100 X-Authenticated: #1417946 X-Provags-ID: V01U2FsdGVkX1/7og0VZln7Vr971lordhsp2R8enQrQYbnExOCmHU V7vpzN+2Jn9uu+ Message-ID: <47BF16B5.6010205@gmx.de> Date: Fri, 22 Feb 2008 19:38:45 +0100 From: Udo Richter User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: VDR Mailing List References: <47B848D2.6080809@cadsoft.de> <20080217202920.0d894faa@Nokia-N800-50-2> <47B9B905.6040905@cadsoft.de> <1203599278.1367.1.camel@lychee.local> In-Reply-To: <1203599278.1367.1.camel@lychee.local> X-Y-GMX-Trusted: 0 Subject: Re: [vdr] [ANNOUNCE] VDR developer version 1.5.15 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.9 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2008 18:39:41 -0000 Status: O X-Status: X-Keywords: X-UID: 15829 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;