diff options
| author | Comment <tim@gray.(none)> | 2013-08-20 20:58:14 +0100 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-08-20 20:58:14 +0100 |
| commit | 95295030238e63890b6ea3113a2741b843e0b8c1 (patch) | |
| tree | 2deaac595841365a0d9c123599abb9380be15dd3 /rotord/src/rotor.cpp | |
| parent | 18b3b3a7f81e03ac7833eb8b99ea9c59274f872a (diff) | |
audio viz: waves node
Diffstat (limited to 'rotord/src/rotor.cpp')
| -rwxr-xr-x | rotord/src/rotor.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/rotord/src/rotor.cpp b/rotord/src/rotor.cpp index 6e0c790..0a1207b 100755 --- a/rotord/src/rotor.cpp +++ b/rotord/src/rotor.cpp @@ -230,6 +230,7 @@ bool Video_output::render(const float duration, const float framerate,const stri float af=0.0f; int aoffs=0; int audioend=0; + Audio_frame *a; while (vf<duration){ //-vstep) { uint16_t *audio=nullptr; if (usingaudio) { @@ -261,6 +262,7 @@ bool Video_output::render(const float duration, const float framerate,const stri af+=exporter.get_audio_step(); aoffs+=exporter.get_audio_framesize(); } + a=new Audio_frame(audio,audioloader.codecContext->channels,samples_in_frame); } @@ -273,17 +275,18 @@ bool Video_output::render(const float duration, const float framerate,const stri //Assertion ff_avcodec_locked failed at libavcodec/utils.c:2967 //cerr<<"videoloader: "<<vf<<" seconds, vstep "<<vstep<<" ,asking for frame "<<((int)((vf*framerate)+0.5))<<endl + Image* i; if (usingaudio) { - i=get_output(Frame_spec(vf,framerate,duration,outW,outH,&Audio_frame(audio,audioloader.codecContext->channels,samples_in_frame))); + i=get_output(Frame_spec(vf,framerate,duration,outW,outH,a)); } else i=get_output(Frame_spec(vf,framerate,duration,outW,outH)); if (i) { exporter.encodeFrame(i->RGBdata); - } vf+=vstep; progress=vf/duration; + if (usingaudio) {delete a;}; } exporter.finishRecord(); |
