Permalink
Browse files

dont add frame if recorder hasn't been initialized

  • Loading branch information...
1 parent b7c0cd5 commit 12c454d7f16344c347fa891cb8f1b69268cd305c @arturoc committed Oct 22, 2012
Showing with 5 additions and 4 deletions.
  1. +1 −0 remask/src/InteractionRecorder.cpp
  2. +4 −4 remask/src/testApp.cpp
@@ -39,6 +39,7 @@ void InteractionRecorder::setup(string path,string currentFace, int w, int h, in
}
void InteractionRecorder::addFrame(ofPixels & frame){
+ if(!recorder) return;
recorder->newFrame(frame);
framesRecorded++;
}
View
@@ -257,7 +257,7 @@ void testApp::update(){
if(found){
if(lastTimeFaceFound==0){
- if(record)recorder.setup(ofGetTimestampString()+".avi","",1280,720,30);
+ if(record) recorder.setup(ofGetTimestampString()+".avi","",1280,720,30);
lastTimeFaceFound = now;
clone1.strength = 0;
clone2.strength = 0;
@@ -349,9 +349,9 @@ void testApp::update(){
lastTimeFaceFound = 0;
clone1.strength = 0;
clone2.strength = 0;
- if(record)recorder.close();
+ if(record) recorder.close();
}else if(lastTimeFaceFound>0){
- if(record)recorder.addFrame(video->getPixelsRef());
+ if(record) recorder.addFrame(video->getPixelsRef());
}
}
videoFrame++;
@@ -361,7 +361,7 @@ void testApp::update(){
if(video==&player && !playerRecorderShutdown && player.getIsMovieDone()){
playerRecorderShutdown = true;
- recorder.close();
+ if(record) recorder.close();
}
}

0 comments on commit 12c454d

Please sign in to comment.