From patchwork Sun Aug 28 22:45:28 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reinhard Nissl X-Patchwork-Id: 12000 Received: from mail.gmx.de ([213.165.64.20] helo=mail.gmx.net) by www.linuxtv.org with smtp (Exim 4.34) id 1E9Vuf-0007qV-HA for vdr@linuxtv.org; Mon, 29 Aug 2005 00:46:05 +0200 Received: (qmail invoked by alias); 28 Aug 2005 22:45:35 -0000 Received: from dialin-145-254-228-146.arcor-ip.net (EHLO [192.168.101.15]) [145.254.228.146] by mail.gmx.net (mp028) with SMTP; 29 Aug 2005 00:45:35 +0200 X-Authenticated: #527675 Message-ID: <43123E88.3070008@gmx.de> Date: Mon, 29 Aug 2005 00:45:28 +0200 From: Reinhard Nissl User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Klaus Schmidinger's VDR X-Y-GMX-Trusted: 0 Subject: [vdr] VDR-1.3.31: moving cutting marks: cDvbPlayer::SkipFrames() is off by one for I frame only recordings (currently radio recordings) X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2005 22:46:05 -0000 Status: O X-Status: X-Keywords: X-UID: 4558 Hi, you may have experienced that moving cutting marks in radio recordings always changes the frame counter by 2. The attached patch fixes this issue. Bye. --- ../vdr-1.3.31-orig/dvbplayer.c 2005-08-14 12:52:45.000000000 +0200 +++ dvbplayer.c 2005-08-29 00:38:32.000000000 +0200 @@ -621,7 +820,10 @@ int cDvbPlayer::SkipFrames(int Frames) int Current, Total; GetIndex(Current, Total, true); int OldCurrent = Current; - Current = index->GetNextIFrame(Current + Frames, Frames > 0); + // As GetNextIFrame() increments/decrements at least once, the + // destination frame (= Current + Frames) must be adjusted by + // -1/+1 respectively. + Current = index->GetNextIFrame(Current + Frames + (Frames > 0 ? -1 : 1), Frames > 0); return Current >= 0 ? Current : OldCurrent; } return -1;