From 91d7ce4f3b8f7bb8d90899f3bb1cac25bfe6bb0d Mon Sep 17 00:00:00 2001 From: Comment Date: Mon, 1 Jul 2013 09:28:35 +0100 Subject: tinkering --- 06_performance/src/oni.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to '06_performance/src/oni.cpp') diff --git a/06_performance/src/oni.cpp b/06_performance/src/oni.cpp index 944a884..8c7dd29 100644 --- a/06_performance/src/oni.cpp +++ b/06_performance/src/oni.cpp @@ -183,16 +183,17 @@ string syncOniPlayer::getCurrentFile(){ return filenames[0]+" "+audio; } void syncOniPlayer::stop(){ + drawable=false; + playerActive=false; soundplayer.stop(); for (int i=0;istop(); - delete players[i]; + //delete players[i]; how to do with thread safety? this doesn't even partly fix it players[i]=NULL; } } - drawable=false; - playerActive=false; + } //================= void oniManager::init(const char* filename){ @@ -220,10 +221,19 @@ void oniManager::init(const char* filename){ } void oniManager::startPlayer(int newplayer){ if (players.size()>newplayer){ - //if (playing>-1) players[playing].stop(); - usleep(10000); - playing=newplayer; - players[playing].play(); + if (playing>-1) players[playing].stop(); + + ///seg fault is definately caused by stopping + ///==if you remove the stop condition, crash doesn't happen + ///however cpu load becomes too much + ///similarly keeping all movies in ram fucks up + //does seg fault happen even if only stopping? + ///how come on the mac we see crashing even in the middle of a sequence? + + //usleep(10000); + playing=newplayer; + players[playing].play(); + } } string oniManager::getCurrentFile(){ -- cgit v1.2.3