From patchwork Wed Mar 14 09:10:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Schmidinger X-Patchwork-Id: 12934 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1S7kFA-0007AU-6x for vdr@linuxtv.org; Wed, 14 Mar 2012 10:11:40 +0100 X-tubIT-Incoming-IP: 188.40.50.18 Received: from racoon.tvdr.de ([188.40.50.18]) by mail.tu-berlin.de (exim-4.75/mailfrontend-2) with esmtps [TLSv1:AES256-SHA:256] for id 1S7kF9-0007gO-Iu; Wed, 14 Mar 2012 10:11:40 +0100 Received: from dolphin.tvdr.de (dolphin.tvdr.de [192.168.100.2]) by racoon.tvdr.de (8.14.3/8.14.3) with ESMTP id q2E9AuTA019092 for ; Wed, 14 Mar 2012 10:10:57 +0100 Received: from [192.168.100.10] (hawk.tvdr.de [192.168.100.10]) by dolphin.tvdr.de (8.14.4/8.14.4) with ESMTP id q2E9ANk0029445 for ; Wed, 14 Mar 2012 10:10:23 +0100 Message-ID: <4F60607F.9050503@tvdr.de> Date: Wed, 14 Mar 2012 10:10:23 +0100 From: Klaus Schmidinger User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.27) Gecko/20120215 SUSE/3.1.19 Thunderbird/3.1.19 MIME-Version: 1.0 To: vdr@linuxtv.org References: <4F5FFE14.3030405@e-tobi.net> In-Reply-To: <4F5FFE14.3030405@e-tobi.net> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0.1 (racoon.tvdr.de [188.40.50.18]); Wed, 14 Mar 2012 10:10:57 +0100 (CET) X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.3.14.90017 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, MSGID_ADDED_BY_MTA 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1300_1399 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_MAILTO 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __USER_AGENT 0' X-LSpam-Score: -1.1 (-) X-LSpam-Report: No, score=-1.1 required=5.0 tests=BAYES_00=-1.9, RDNS_NONE=0.793 autolearn=no Subject: Re: [vdr] locale issue with --edit X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.13 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: Wed, 14 Mar 2012 09:11:40 -0000 Status: O X-Status: X-Keywords: X-UID: 25934 On 14.03.2012 03:10, Tobi wrote: > This was driving me mad! > > I have a NTSC TS-recording with 29.97002997 fps. > > When I set cut marks via the VDR-OSD and cut the recording, this works fine. > > But when I cut the same recording with the same cut marks with > `vdr --edit`, the cut points are offset by some seconds e.g. the beginning > of the cutted recording is about 9 seconds earlier than it should be. > > Reason: When invoking `vdr --edit` LC_NUMERIC is *not* set to "C" yet when > CutRecording() is called. My default locale uses "," as the decimal > point, causing the framerate to be parsed as 29.0 instead of 29.97002997. > > setlocale(LC_NUMERIC, "C") should be called earlier in main(). Can you please verify that this works? Klaus --- vdr.c 2012/03/09 09:55:15 2.34 +++ vdr.c 2012/03/14 09:09:19 @@ -173,6 +173,7 @@ // Initiate locale: setlocale(LC_ALL, ""); + setlocale(LC_NUMERIC, "C"); // makes sure any floating point numbers written use a decimal point // Command line options: @@ -550,7 +551,6 @@ isyslog("codeset is '%s' - %s", CodeSet, known ? "known" : "unknown"); cCharSetConv::SetSystemCharacterTable(CodeSet); } - setlocale(LC_NUMERIC, "C"); // makes sure any floating point numbers written use a decimal point // Initialize internationalization: