summaryrefslogtreecommitdiff
path: root/rotord
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2013-09-10 14:31:04 +0100
committerTim Redfern <tim@eclectronics.org>2013-09-10 14:31:04 +0100
commit438b85dba5c7b59c736a8c2b69667370afcc20da (patch)
tree4d7fa4b0c0c3d3f683050f159e0f1942b29a97fc /rotord
parent9ef45919f0eb3bebeb6ee1ee6e1da2d859b43790 (diff)
free audio frame on finish export
Diffstat (limited to 'rotord')
-rw-r--r--rotord/src/libavwrapper.cpp6
-rw-r--r--rotord/src/nodes_audio_analysis.cpp3
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;