You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Fix regression from time re-mapping changes, which added an infinite Clip cache on accident - causing a large memory leak. Also fixing a small logic regression in FrameMapper, designed to skip audio sample re-distribution, if all settings are the same as the source file.
This commit is contained in:
@@ -95,9 +95,6 @@ void Clip::init_settings()
|
||||
|
||||
// Init reader info struct
|
||||
init_reader_settings();
|
||||
|
||||
// Init cache
|
||||
final_cache.SetMaxBytesFromInfo(10, info.width, info.height, info.sample_rate, info.channels);
|
||||
}
|
||||
|
||||
// Init reader info details
|
||||
@@ -108,6 +105,9 @@ void Clip::init_reader_settings() {
|
||||
|
||||
// Initialize info struct
|
||||
info = reader->info;
|
||||
|
||||
// Init cache
|
||||
final_cache.SetMaxBytesFromInfo(8, info.width, info.height, info.sample_rate, info.channels);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -491,7 +491,8 @@ std::shared_ptr<Frame> FrameMapper::GetFrame(int64_t requested_frame)
|
||||
if (info.sample_rate == mapped_frame->SampleRate() &&
|
||||
info.channels == mapped_frame->GetAudioChannelsCount() &&
|
||||
info.channel_layout == mapped_frame->ChannelsLayout() &&
|
||||
mapped.Samples.total == mapped_frame->GetAudioSamplesCount() == samples_in_frame && is_increasing &&
|
||||
mapped.Samples.total == mapped_frame->GetAudioSamplesCount() &&
|
||||
mapped.Samples.total == samples_in_frame && is_increasing &&
|
||||
mapped.Samples.frame_start == mapped.Odd.Frame &&
|
||||
mapped.Samples.sample_start == 0 &&
|
||||
mapped_frame->number == frame_number &&// in some conditions (e.g. end of stream)
|
||||
|
||||
Reference in New Issue
Block a user