summaryrefslogtreecommitdiff
path: root/06_performance/src/oni.cpp
diff options
context:
space:
mode:
authorComment <tim@gray.(none)>2013-07-01 09:28:35 +0100
committerComment <tim@gray.(none)>2013-07-01 09:28:35 +0100
commit91d7ce4f3b8f7bb8d90899f3bb1cac25bfe6bb0d (patch)
tree7162ecc90b22caf25f030102eac92ef687dc649d /06_performance/src/oni.cpp
parentb0464b8b1f4496a35a6ad3a6bfac5cc9e02101ea (diff)
tinkeringHEADmaster
Diffstat (limited to '06_performance/src/oni.cpp')
-rw-r--r--06_performance/src/oni.cpp24
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(){