From c355bd7569136ce1972ec39696990dad67f1be13 Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Tue, 22 Feb 2022 23:32:43 +0100 Subject: [PATCH] Bugfix: update depth of sources from dropped media file To be investigated further if problem persists: patch seems to work (increment twice View::need_deep_update_) but not fully sure why two frames are necessary... --- MediaSource.cpp | 4 ++-- Mixer.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MediaSource.cpp b/MediaSource.cpp index 33712f4..dcc14c5 100644 --- a/MediaSource.cpp +++ b/MediaSource.cpp @@ -118,8 +118,8 @@ void MediaSource::init() // force update of activation mode active_ = true; - // deep update to reorder - ++View::need_deep_update_; + // deep update to reorder (two frames to give time to insert) + View::need_deep_update_ += 2; // done init Log::Info("Source '%s' linked to Media %s.", name().c_str(), std::to_string(mediaplayer_->id()).c_str()); diff --git a/Mixer.cpp b/Mixer.cpp index 45c96a0..8359a59 100644 --- a/Mixer.cpp +++ b/Mixer.cpp @@ -453,7 +453,7 @@ void Mixer::insertSource(Source *s, View::Mode m) // switch to this view to show source created setView(m); - current_view_->update(0.f); + current_view_->update(dt_); current_view_->centerSource(s); // set this new source as current