From patchwork Tue Mar 20 20:02:05 2007 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Udo Richter X-Patchwork-Id: 12447 Received: from mail.gmx.net ([213.165.64.20]) by www.linuxtv.org with smtp (Exim 4.50) id 1HTkYI-0006aj-Ds for vdr@linuxtv.org; Tue, 20 Mar 2007 21:03:26 +0100 Received: (qmail invoked by alias); 20 Mar 2007 20:02:54 -0000 Received: from p57A89D03.dip0.t-ipconnect.de (EHLO localhost) [87.168.157.3] by mail.gmx.net (mp002) with SMTP; 20 Mar 2007 21:02:54 +0100 X-Authenticated: #1417946 X-Provags-ID: V01U2FsdGVkX1/gS99QJbngj6JLHMS/n+vMghdu/B2C+yRogMme0r P7+eD0X2I8NuvZ Message-ID: <46003DBD.6070804@gmx.de> Date: Tue, 20 Mar 2007 21:02:05 +0100 From: Udo Richter User-Agent: Thunderbird 2.0pre (Windows/20070315) MIME-Version: 1.0 To: VDR Mailing List Subject: Re: [vdr] Hard link cutter References: <41B8FC3A.2040707@gmx.de> <45FBFCAA.7000903@gmx.de> <1174324079.3924.8.camel@wopr.deltab.de> In-Reply-To: <1174324079.3924.8.camel@wopr.deltab.de> X-Y-GMX-Trusted: 0 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 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: Tue, 20 Mar 2007 20:03:26 -0000 Status: O X-Status: X-Keywords: X-UID: 12535 Andreas Brachold wrote: > i like your patch, but its work only on some recordings. > Its failed with a segmentation fault, on cutting. > The only differ are unbalanced marks (out missed) Confirmed, the patch doesn't handle the case that the last mark is a cut-in mark, not a cut-out. In that case 'Mark' will be NULL, causing a segfault. The attached (untested) patch should do the trick. Cheers, Udo Index: cutter.c =================================================================== --- cutter.c (revision 895) +++ cutter.c (working copy) @@ -167,8 +167,9 @@ uchar MarkFileNumber; int MarkFileOffset; // Get file number of next cut mark - if (fromIndex->Get(Mark->position, &MarkFileNumber, &MarkFileOffset) - && (MarkFileNumber != CurrentFileNumber)) { + if (!Mark + || fromIndex->Get(Mark->position, &MarkFileNumber, &MarkFileOffset) + && (MarkFileNumber != CurrentFileNumber)) { // The current source file will be copied completely. // Start new output file unless we did that already if (FileSize != 0) {