From 91b205e7bd08d45c60f243d7da6e7fa6d5f06aab Mon Sep 17 00:00:00 2001 From: Fredrik Mellbin Date: Wed, 31 Dec 2008 13:46:09 +0000 Subject: [PATCH] FFMS2 Forgot debug code that made seeking slow Originally committed to SVN as r2592. --- FFmpegSource2/ffvideosource.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FFmpegSource2/ffvideosource.cpp b/FFmpegSource2/ffvideosource.cpp index 7968d4507..d110aa16f 100644 --- a/FFmpegSource2/ffvideosource.cpp +++ b/FFmpegSource2/ffvideosource.cpp @@ -327,7 +327,7 @@ AVFrameLite *FFVideoSource::GetFrame(int n, char *ErrorMsg, unsigned MsgSize) { } else { // 10 frames is used as a margin to prevent excessive seeking since the predicted best keyframe isn't always selected by avformat if (n < CurrentFrame || ClosestKF > CurrentFrame + 10 || (SeekMode == 3 && n > CurrentFrame + 10)) { - av_seek_frame(FormatContext, VideoTrack, (SeekMode == 3) ? Frames[n].DTS : Frames[FFMAX(ClosestKF - 20, 0)].DTS, AVSEEK_FLAG_BACKWARD); + av_seek_frame(FormatContext, VideoTrack, (SeekMode == 3) ? Frames[n].DTS : Frames[ClosestKF].DTS, AVSEEK_FLAG_BACKWARD); avcodec_flush_buffers(CodecContext); HasSeeked = true; }