From ac49729ed0e215cd0ce0be4b96ed05016008c03f Mon Sep 17 00:00:00 2001 From: Andrew Wason Date: Tue, 2 Jan 2024 14:34:48 -0500 Subject: [PATCH] optimize seeking --- src/mediafx/video_track.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mediafx/video_track.cpp b/src/mediafx/video_track.cpp index e92185a..b55fd55 100644 --- a/src/mediafx/video_track.cpp +++ b/src/mediafx/video_track.cpp @@ -159,7 +159,7 @@ bool VideoTrack::initialize(FFMS_Index* index, const char* sourceFile, ErrorInfo { int videoTrackNum = FFMS_GetFirstTrackOfType(index, FFMS_TYPE_VIDEO, &errorInfo); if (videoTrackNum >= 0) { - FFMS_VideoSource* videoSource = FFMS_CreateVideoSource(sourceFile, videoTrackNum, index, 1, FFMS_SEEK_LINEAR, &errorInfo); + FFMS_VideoSource* videoSource = FFMS_CreateVideoSource(sourceFile, videoTrackNum, index, 1, mediaClip()->clipStart() == 0 ? FFMS_SEEK_LINEAR_NO_RW : FFMS_SEEK_NORMAL, &errorInfo); if (videoSource) { const FFMS_Frame* frameProperties = FFMS_GetFrame(videoSource, 0, &errorInfo); if (frameProperties) {