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