diff --git a/src/ofxVideoRecorder.cpp b/src/ofxVideoRecorder.cpp index ba26a57..25000b1 100644 --- a/src/ofxVideoRecorder.cpp +++ b/src/ofxVideoRecorder.cpp @@ -347,6 +347,7 @@ bool ofxVideoRecorder::setupCustomOutput(int w, int h, float fps, int sampleRate bIsInitialized = true; bIsRecording = false; bIsPaused = false; + bIsAutoSync = true; startTime = 0; recordingDuration = 0; @@ -363,7 +364,7 @@ bool ofxVideoRecorder::addFrame(const ofPixels &pixels){ { int framesToAdd = 1; // default add one frame per request - if((bRecordAudio || bSysClockSync) && !bFinishing){ + if(bIsAutoSync && (bRecordAudio || bSysClockSync) && !bFinishing){ double syncDelta; double videoRecordedTime = videoFramesRecorded / frameRate; @@ -470,6 +471,11 @@ void ofxVideoRecorder::setPaused(bool bPause){ } } +//-------------------------------------------------------------- +void ofxVideoRecorder::setAutoSync(bool bAutoSync){ + bIsAutoSync = bAutoSync; +} + //-------------------------------------------------------------- void ofxVideoRecorder::close(){ if(!bIsInitialized) return; diff --git a/src/ofxVideoRecorder.h b/src/ofxVideoRecorder.h index afe819b..9009cd7 100644 --- a/src/ofxVideoRecorder.h +++ b/src/ofxVideoRecorder.h @@ -135,6 +135,7 @@ class ofxVideoRecorder : public ofThread void start(); void close(); void setPaused(bool bPause); + void setAutoSync(bool bAutoSync); bool hasVideoError(); bool hasAudioError(); @@ -178,6 +179,7 @@ class ofxVideoRecorder : public ofThread bool bRecordVideo; bool bIsRecording; bool bIsPaused; + bool bIsAutoSync; bool bFinishing; bool bIsSilent;