X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fplaybackengine.C;h=571afe2a83a174a3eaeeab536182258131839d2b;hp=82bd7bb6587b930b77caa7f4da7673255539b3a3;hb=45a8ba3455cf252332c03533a7590df5267ce9aa;hpb=f5725c7e12def18fec49a295dad688652edaa4b3 diff --git a/cinelerra-5.1/cinelerra/playbackengine.C b/cinelerra-5.1/cinelerra/playbackengine.C index 82bd7bb6..571afe2a 100644 --- a/cinelerra-5.1/cinelerra/playbackengine.C +++ b/cinelerra-5.1/cinelerra/playbackengine.C @@ -71,6 +71,7 @@ PlaybackEngine::PlaybackEngine(MWindow *mwindow, Canvas *output) tracking_done = new Condition(1, "PlaybackEngine::tracking_done"); pause_lock = new Condition(0, "PlaybackEngine::pause_lock"); start_lock = new Condition(0, "PlaybackEngine::start_lock"); + cache_lock = new Mutex("PlaybackEngine::cache_lock"); input_lock = new Condition(1, "PlaybackEngine::input_lock"); output_lock = new Condition(0, "PlaybackEngine::output_lock", 1); @@ -93,6 +94,7 @@ PlaybackEngine::~PlaybackEngine() delete tracking_done; delete pause_lock; delete start_lock; + delete cache_lock; delete renderengine_lock; delete command; delete next_command; @@ -164,12 +166,14 @@ void PlaybackEngine::wait_render_engine() void PlaybackEngine::create_cache() { + cache_lock->lock("PlaybackEngine::create_cache"); if( audio_cache ) audio_cache->remove_user(); if( video_cache ) video_cache->remove_user(); audio_cache = new CICache(preferences); video_cache = new CICache(preferences); + cache_lock->unlock(); } @@ -462,6 +466,12 @@ int PlaybackEngine::get_direction() return TransportCommand::get_direction(curr_command); } +void PlaybackEngine::update_preferences(Preferences *prefs) +{ + preferences->copy_from(prefs); + create_render_engine(); +} + void PlaybackEngine::send_command(int command, EDL *edl, int wait_tracking, int use_inout) { //printf("PlaybackEngine::send_command 1 %d\n", command);