From 26564874e94ec621bf8774d0b38414800bc76679 Mon Sep 17 00:00:00 2001 From: Flamefire Date: Wed, 12 Mar 2014 16:43:03 +0100 Subject: [PATCH] Improve skipping --- Vocaluxe/Lib/Video/Acinerella/CDecoderThread.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Vocaluxe/Lib/Video/Acinerella/CDecoderThread.cs b/Vocaluxe/Lib/Video/Acinerella/CDecoderThread.cs index 522e7fc7..2b254b98 100644 --- a/Vocaluxe/Lib/Video/Acinerella/CDecoderThread.cs +++ b/Vocaluxe/Lib/Video/Acinerella/CDecoderThread.cs @@ -1,5 +1,4 @@ using System; -using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; using System.Threading; @@ -328,7 +327,9 @@ namespace Vocaluxe.Lib.Video.Acinerella { try { - var frameDropCount = (int)(timeDifference / _FrameDuration); + var frameDropCount = (int)Math.Ceiling(timeDifference / _FrameDuration); + // Add 1 dropped frame per 16 frames (Power of 2 -> Div is fast) as skipping takes time too and we don't want to skip again + frameDropCount += frameDropCount / 16; hasFrameDecoded = CAcinerella.AcSkipFrames(_Instance, _Videodecoder, frameDropCount); } catch (Exception)