summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrotord/src/rotor.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/rotord/src/rotor.cpp b/rotord/src/rotor.cpp
index 73ef0cc..407004e 100755
--- a/rotord/src/rotor.cpp
+++ b/rotord/src/rotor.cpp
@@ -212,10 +212,13 @@ bool Video_output::render(const float duration, const float framerate,const stri
gettimeofday(&start, NULL);
- //does audioloader output interleaved samples?
- int samples_in_frame=(audioloader.codecContext->channels*audioloader.codecContext->sample_rate)/framerate;
- string whether=usingaudio?"Loading":"Cannot load";
- logger.information(whether+" audio file: "+audio_filename+", each frame contains "+ofToString(samples_in_frame)+" samples at "+ofToString(audioloader.codecContext->sample_rate)+" hz");
+ if (usingaudio){
+ //does audioloader output interleaved samples?
+ int samples_in_frame=(audioloader.codecContext->channels*audioloader.codecContext->sample_rate)/framerate;
+ string whether=usingaudio?"Loading":"Cannot load";
+ logger.information(whether+" audio file: "+audio_filename+", each frame contains "+ofToString(samples_in_frame)+" samples at "+ofToString(audioloader.codecContext->sample_rate)+" hz");
+ uint16_t *audioframe=new uint16_t[samples_in_frame];
+ }
float vstep=1.0f/framerate;
float v=0.0f;
@@ -261,7 +264,12 @@ bool Video_output::render(const float duration, const float framerate,const stri
logger.information("Video_output: rendered "+output_filename+": in "+ofToString(mtime)+" seconds");
- if (usingaudio) audioloader.close();
+ if (usingaudio) {
+ audioloader.close();
+ delete[] audioframe;
+ }
+
+
return true;
}
@@ -311,8 +319,6 @@ Image* Video_loader::output(const Frame_spec &frame){
wanted=(((int) ((frame.time*frame.framerate*clipspeed)+0.5))%(player.getNumberOfFrames()-1))+1; //+1 is necessary because 1st frame in a video is number 1?
}
- cerr<<"Video_loader: wanted frame "<<wanted<<endl;
-
if (wanted!=lastframe){
if (!player.fetchFrame(frame.w,frame.h,wanted)) { //seek fail
Logger& logger = Logger::get("Rotor");