diff options
Diffstat (limited to '06_performance/src/oni.cpp')
| -rw-r--r-- | 06_performance/src/oni.cpp | 24 |
1 files changed, 17 insertions, 7 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(){ |
