From 111c1b1d5e8276d348854cae1e3f9b0b6f52236d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 26 Feb 2007 21:29:50 +0000 Subject: [PATCH] fix a couple uninitialized variable messages git-svn-id: svn://localhost/ardour2/trunk@1516 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/audio_diskstream.cc | 5 +++++ libs/ardour/reverse.cc | 11 ++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index 48f3771019..f0316894e2 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -1305,6 +1305,11 @@ AudioDiskstream::do_flush (Session::RunContext context, bool force_flush) _write_data_count = 0; + transvec.buf[0] = 0; + transvec.buf[1] = 0; + vector.buf[0] = 0; + vector.buf[1] = 0; + for (ChannelList::iterator chan = channels.begin(); chan != channels.end(); ++chan) { (*chan).capture_buf->get_read_vector (&vector); diff --git a/libs/ardour/reverse.cc b/libs/ardour/reverse.cc index e0cc5d95fb..fc58e161aa 100644 --- a/libs/ardour/reverse.cc +++ b/libs/ardour/reverse.cc @@ -47,7 +47,7 @@ Reverse::run (boost::shared_ptr region) SourceList nsrcs; SourceList::iterator si; nframes_t blocksize = 256 * 1024; - Sample* buf; + Sample* buf = 0; nframes_t fpos; nframes_t fstart; nframes_t to_read; @@ -69,8 +69,6 @@ Reverse::run (boost::shared_ptr region) buf = new Sample[blocksize]; to_read = blocksize; - cerr << "Reverse " << region->name() << " len = " << region->length() << " blocksize = " << blocksize << " start at " << fstart << endl; - /* now read it backwards */ while (to_read) { @@ -80,8 +78,6 @@ Reverse::run (boost::shared_ptr region) for (n = 0, si = nsrcs.begin(); n < region->n_channels(); ++n, ++si) { /* read it in */ - - cerr << "read at " << fpos << " for " << to_read << endl; if (region->source (n)->read (buf, fpos, to_read) != to_read) { goto out; @@ -105,7 +101,6 @@ Reverse::run (boost::shared_ptr region) to_read = blocksize; } else { to_read = fpos - fstart; - cerr << "Last read detected, only " << fpos - fstart << " left; move to start and read " << to_read << endl; fpos = fstart; } }; @@ -114,7 +109,9 @@ Reverse::run (boost::shared_ptr region) out: - delete [] buf; + if (buf) { + delete [] buf; + } if (ret) { for (si = nsrcs.begin(); si != nsrcs.end(); ++si) { -- 2.30.2