You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Adding new memory trimming to more forcefully return memory to the OS after major memory clearing events (i.e. clearing all cache, closing readers, or large amounts of cache cleared). Also, refactoring default cache sizes in Timeline, FrameMapper, and FFmpegReader to better support high frame rate and high resolution videos (i.e. 4k 60 fps) so we don't immediately run out of memory.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "FrameMapper.h"
|
||||
#include "Exceptions.h"
|
||||
#include "Clip.h"
|
||||
#include "MemoryTrim.h"
|
||||
#include "ZmqLogger.h"
|
||||
|
||||
using namespace std;
|
||||
@@ -745,6 +746,9 @@ void FrameMapper::Close()
|
||||
SWR_FREE(&avr);
|
||||
avr = NULL;
|
||||
}
|
||||
|
||||
// Release free’d arenas back to OS after heavy teardown
|
||||
TrimMemoryToOS(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -841,7 +845,7 @@ void FrameMapper::ChangeMapping(Fraction target_fps, PulldownType target_pulldow
|
||||
final_cache.Clear();
|
||||
|
||||
// Adjust cache size based on size of frame and audio
|
||||
final_cache.SetMaxBytesFromInfo(OPEN_MP_NUM_PROCESSORS, info.width, info.height, info.sample_rate, info.channels);
|
||||
final_cache.SetMaxBytesFromInfo(24, info.width, info.height, info.sample_rate, info.channels);
|
||||
|
||||
// Deallocate resample buffer
|
||||
if (avr) {
|
||||
|
||||
Reference in New Issue
Block a user