From e91c43d99cb7f1b4893b272b5f3f92a6b9c86542 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Fri, 24 Feb 2012 13:13:19 +0100 Subject: [PATCH] workaround for the FFmpeg mkv seek bug --- Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs b/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs index 2ecdcc7b..3dac356e 100644 --- a/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs +++ b/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs @@ -409,9 +409,9 @@ namespace Vocaluxe.Lib.Video { CAcinerella.ac_seek(_videodecoder, -1, (Int64)(_SkipTime * 1000f)); } - catch (Exception) + catch (Exception e) { - ; + CLog.LogError("Error seeking video file \"" + _FileName + "\": " + e.Message); } } @@ -422,9 +422,9 @@ namespace Vocaluxe.Lib.Video { CAcinerella.ac_seek(_videodecoder, -1, (Int64)0); } - catch (Exception) + catch (Exception e) { - ; + CLog.LogError("Error seeking video file \"" + _FileName + "\": " + e.Message); } } @@ -580,6 +580,7 @@ namespace Vocaluxe.Lib.Video return; int FrameFinished = 0; + bool error = false; if (DropFrame && !_BeforeLoop) { try @@ -603,6 +604,7 @@ namespace Vocaluxe.Lib.Video } catch (Exception) { + error = true; CLog.LogError("Error AcGetFrame " + _FileName); } @@ -647,7 +649,8 @@ namespace Vocaluxe.Lib.Video } else { - _NoMoreFrames = true; + if (!error) // just a quick and dirty workaround for the mkv seek bug in ffmpeg + _NoMoreFrames = true; } return; }