diff options
Diffstat (limited to 'rotord/src')
| -rw-r--r-- | rotord/src/libavwrapper.cpp | 6 | ||||
| -rw-r--r-- | rotord/src/nodes_audio_analysis.cpp | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/rotord/src/libavwrapper.cpp b/rotord/src/libavwrapper.cpp index 0ba76ea..15a84d1 100644 --- a/rotord/src/libavwrapper.cpp +++ b/rotord/src/libavwrapper.cpp @@ -1241,7 +1241,7 @@ void libav::exporter::open_video(AVFormatContext *oc, AVCodec *codec, AVStream * { AVCodecContext *c; AVPacket pkt = { 0 }; // data and size must be 0; - AVFrame *frame = avcodec_alloc_frame(); + AVFrame *frame = avcodec_alloc_frame(); int got_packet, ret; av_init_packet(&pkt); @@ -1281,6 +1281,8 @@ void libav::exporter::open_video(AVFormatContext *oc, AVCodec *codec, AVStream * pkt.stream_index = st->index; + avcodec_free_frame(&frame); + // Write the compressed frame to the media file. // ret = av_interleaved_write_frame(oc, &pkt); if (ret != 0) { @@ -1288,7 +1290,7 @@ void libav::exporter::open_video(AVFormatContext *oc, AVCodec *codec, AVStream * // av_err2str(ret)); exit(1); } - avcodec_free_frame(&frame); + } void libav::exporter::write_audio_frame(AVFormatContext *oc, AVStream *st,AVPacket *pkt) diff --git a/rotord/src/nodes_audio_analysis.cpp b/rotord/src/nodes_audio_analysis.cpp index 7e735f8..85894d9 100644 --- a/rotord/src/nodes_audio_analysis.cpp +++ b/rotord/src/nodes_audio_analysis.cpp @@ -44,7 +44,8 @@ namespace Rotor{ } if (sample==samples_per_column) { //finished a column //get root-mean - double mean=pow(accum/samples,0.5); + //why does valgrind complain here about uninitialised vars + double mean=pow(accum/samples,0.5f); vectordata[column]=mean; column++; sample=0; |
