You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Refactored the cache class to only apply the max frames against "previous" frames, and allow unlimited number of future frames, to account for different types of files (some which have hundreds of tiny frames, which need large future cache).
This commit is contained in:
@@ -4,7 +4,7 @@ using namespace openshot;
|
||||
|
||||
FFmpegReader::FFmpegReader(string path) throw(InvalidFile, NoStreamsFound, InvalidCodec)
|
||||
: last_video_frame(0), last_audio_frame(0), is_seeking(0), seeking_pts(0), seeking_frame(0),
|
||||
audio_pts_offset(99999), video_pts_offset(99999), working_cache(130), final_cache(130), path(path),
|
||||
audio_pts_offset(99999), video_pts_offset(99999), working_cache(30), final_cache(30), path(path),
|
||||
is_video_seek(true), check_interlace(false), check_fps(false), init_settings(false),
|
||||
enable_seek(true) { // , resampleCtx(NULL)
|
||||
|
||||
@@ -374,8 +374,14 @@ Frame FFmpegReader::ReadStream(int requested_frame)
|
||||
|
||||
// Return requested frame (if found)
|
||||
if (final_cache.Exists(requested_frame))
|
||||
{
|
||||
// Set cache's current frame
|
||||
working_cache.SetCurrentFrame(requested_frame);
|
||||
final_cache.SetCurrentFrame(requested_frame);
|
||||
|
||||
// Return prepared frame
|
||||
return final_cache.GetFrame(requested_frame);
|
||||
}
|
||||
else
|
||||
// Return blank frame
|
||||
return CreateFrame(requested_frame);
|
||||
|
||||
Reference in New Issue
Block a user