diff options
| author | Comment <tim@gray.(none)> | 2013-07-01 09:28:35 +0100 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-07-01 09:28:35 +0100 |
| commit | 91d7ce4f3b8f7bb8d90899f3bb1cac25bfe6bb0d (patch) | |
| tree | 7162ecc90b22caf25f030102eac92ef687dc649d /06_performance | |
| parent | b0464b8b1f4496a35a6ad3a6bfac5cc9e02101ea (diff) | |
Diffstat (limited to '06_performance')
| -rw-r--r-- | 06_performance/src/oni.cpp | 24 | ||||
| -rw-r--r-- | 06_performance/src/testApp.cpp | 6 |
2 files changed, 21 insertions, 9 deletions
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;i<players.size();i++) { if (players[i]!=NULL) { players[i]->stop(); - 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); } |
