mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Disabling threaded session loading: crashing :(
This commit is contained in:
10
Mixer.cpp
10
Mixer.cpp
@@ -25,6 +25,8 @@ using namespace tinyxml2;
|
||||
|
||||
#include "Mixer.h"
|
||||
|
||||
//#define THREADED_LOADING
|
||||
|
||||
// static semaphore to prevent multiple threads for load / save
|
||||
static std::atomic<bool> sessionThreadActive_ = false;
|
||||
static std::atomic<bool> sessionSwapRequested_ = false;
|
||||
@@ -617,9 +619,13 @@ void Mixer::load(const std::string& filename)
|
||||
// create empty session
|
||||
back_session_ = new Session;
|
||||
|
||||
#ifdef THREADED_LOADING
|
||||
// launch a thread to load the session into back_session
|
||||
// lock will be unlocked when thread ends
|
||||
std::thread (loadSession, filename, back_session_).detach();
|
||||
#else
|
||||
loadSession (filename, back_session_);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Mixer::open(const std::string& filename)
|
||||
@@ -659,9 +665,13 @@ void Mixer::import(const std::string& filename)
|
||||
// create empty session
|
||||
back_session_ = new Session;
|
||||
|
||||
#ifdef THREADED_LOADING
|
||||
// launch a thread to load the session into back_session
|
||||
// lock will be unlocked when thread ends
|
||||
std::thread (importSession, filename, back_session_).detach();
|
||||
#else
|
||||
importSession (filename, back_session_);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Mixer::merge(Session *session)
|
||||
|
||||
@@ -404,13 +404,14 @@ CloneSource *Source::clone()
|
||||
CloneSource::CloneSource(Source *origin) : Source(), origin_(origin)
|
||||
{
|
||||
// create surface:
|
||||
clonesurface_ = new Surface(renderingshader_);
|
||||
clonesurface_ = nullptr;
|
||||
}
|
||||
|
||||
CloneSource::~CloneSource()
|
||||
{
|
||||
// delete surface
|
||||
delete clonesurface_;
|
||||
if (clonesurface_)
|
||||
delete clonesurface_;
|
||||
}
|
||||
|
||||
CloneSource *CloneSource::clone()
|
||||
@@ -432,6 +433,7 @@ void CloneSource::init()
|
||||
if (origin_ && origin_->ready()) {
|
||||
|
||||
// get the texture index from framebuffer of view, apply it to the surface
|
||||
clonesurface_ = new Surface(renderingshader_);
|
||||
clonesurface_->setTextureIndex( origin_->texture() );
|
||||
|
||||
// create Frame buffer matching size of session
|
||||
|
||||
Reference in New Issue
Block a user