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 +++++++++++++++++------- 06_performance/src/testApp.cpp | 6 ++++-- 2 files changed, 21 insertions(+), 9 deletions(-) (limited to '06_performance/src') 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(){ diff --git a/06_performance/src/testApp.cpp b/06_performance/src/testApp.cpp index ffdc895..4736b54 100644 --- a/06_performance/src/testApp.cpp +++ b/06_performance/src/testApp.cpp @@ -127,8 +127,8 @@ void testApp::setup(){ F_zRotation=0; F_particleAmount=2000; //100 - F_particleLife=0.75; //0.5 - F_particleSize=16.0; //1.0; + F_particleLife=1.5; //0.5 + F_particleSize=10.0; //1.0; I_fade1=0; @@ -189,6 +189,8 @@ void testApp::setup(){ videoclips.push_back(ofVideoPlayer()); videoclips[i].loadMovie(XML.getAttribute("video","file","",i)); videoclips[i].setLoopState(OF_LOOP_NONE); + videoclips[i].stop(); + videoclips[i].setPosition(0.0f); //videoclips[i].play(); //videoclips[i].setSpeed(0.0f); } -- cgit v1.2.3