Collect Playlist::ContentsChanged() signals #8626

With a large session:

Editor::insert_time()
 -> Playlist::shift()
 -> 4000+ regions are modified
 -> 4k calls to Region::send_change()
 -> --"-- Playlist::region_changed ()
 -> --"-- Playlist::region_bounds_changed ()
 -> --"-- Playlist::notify_contents_changed ()
 -> --"-- ContentsChanged () /* EMIT SIGNAL */
 -> --"-- DiskReader::playlist_modified ()
 -> 4k Session::request_overwrite_buffer events are queued

The butler thread processes them all in the background, but
this also enqueues 4k+ events to the GUI event pool since the
GUI subscribed to Playlist::ContentsChanged ().

However the GUI is inside Editor::insert_time() and cannot handle
events. So they keep accumulating, and eventually hits
"POOL OUT OF MEMORY - RECOMPILE WITH LARGER SIZE!"

-=-
This fixes the issue by collecting blocking ::notify_contents_changed
until all region_changed() events are processed, and a single call
to Playlist::flush_notifications() notifies the UI and disk-reader.
This commit is contained in:
Robin Gareus 2021-03-21 22:44:37 +01:00
parent d08b9eaa8d
commit 6ac8ee41af
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -326,10 +326,10 @@ protected:
~RegionWriteLock () ~RegionWriteLock ()
{ {
Glib::Threads::RWLock::WriterLock::release (); Glib::Threads::RWLock::WriterLock::release ();
thawlist.release ();
if (block_notify) { if (block_notify) {
playlist->release_notifications (); playlist->release_notifications ();
} }
thawlist.release ();
} }
ThawList thawlist; ThawList thawlist;