From 147f2d29a85cb1af80459546d95857e1ce3344f3 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Wed, 8 May 2013 10:06:00 +0100 Subject: fixed output hang --- rotord/rotor.cpp | 43 ++++++++----------------------------------- 1 file changed, 8 insertions(+), 35 deletions(-) (limited to 'rotord/rotor.cpp') diff --git a/rotord/rotor.cpp b/rotord/rotor.cpp index 67f8c0c..c25fed4 100755 --- a/rotord/rotor.cpp +++ b/rotord/rotor.cpp @@ -181,47 +181,20 @@ bool Video_output::render(const float duration, const float framerate,const stri float v=0.0f; float vf=0.0f; float af=0.0f; - while (vf0.998) { - //stop here - int nothing=0; - //seems that the last frame of samples causes std::max to have - } - else { //DIRTY HACK - //seems to be that the audio frames have to be a little ahead - //and the frame->pts comes from video - while (fless(vf,af)) { - //insert audio frames until we are ahead of the video - uint16_t* s=audioloader.get_samples(exporter->get_audio_framesize()); - if (s) { - exporter->encodeFrame(s); - } - af+=exporter->get_audio_step(); - } - } + while (vfencodeFrame(audioloader.get_samples(exporter->get_audio_framesize())); + af+=exporter->get_audio_step(); + } + + Image* i=get_output(Frame_spec(vf,framerate,outW,outH)); if (i) { exporter->encodeFrame(i->RGBdata); } vf+=vstep; progress=vf/duration; - - - /* - if (!exporter->encodeFrame(i->RGBdata)){ - //if (!exporter->encodeFrame(get_output(Frame_spec(f,framerate,outW,outH))->RGBdata,audioloader.get_packet())){ - cerr << "Rotor: video output failed"<99.5){ - - cerr<<"stop here"<finishRecord(); -- cgit v1.2.3