From 104e4c140f4800751297bba6ccbe7a47e930f0b0 Mon Sep 17 00:00:00 2001 From: Chris Moeller Date: Wed, 26 Mar 2014 02:27:51 -0700 Subject: [PATCH] Fixed seeking to the end of files with FFMPEG plug-in --- Plugins/FFMPEG/FFMPEGDecoder.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Plugins/FFMPEG/FFMPEGDecoder.m b/Plugins/FFMPEG/FFMPEGDecoder.m index 1d8215884..480f1ba85 100644 --- a/Plugins/FFMPEG/FFMPEGDecoder.m +++ b/Plugins/FFMPEG/FFMPEGDecoder.m @@ -303,7 +303,11 @@ int lockmgr_callback(void ** mutex, enum AVLockOp op) - (long)seek:(long)frame { - if (frame >= totalFrames) { return -1; } + if (frame >= totalFrames) + { + framesRead = totalFrames; + return -1; + } int64_t ts = frame * (formatCtx->duration) / totalFrames; avformat_seek_file(formatCtx, -1, ts - 1000, ts, ts, AVSEEK_FLAG_ANY); avcodec_flush_buffers(codecCtx);