fix a couple uninitialized variable messages
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 26 Feb 2007 21:29:50 +0000 (21:29 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 26 Feb 2007 21:29:50 +0000 (21:29 +0000)
git-svn-id: svn://localhost/ardour2/trunk@1516 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/audio_diskstream.cc
libs/ardour/reverse.cc

index 48f3771019501c4f6822de6fa0665e4d840b6e6e..f0316894e2e50cb53b7000a53bd9f263fd5adcad 100644 (file)
@@ -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);
index e0cc5d95fbb5b5c7c6c7608196c166a8e2a1944c..fc58e161aa0d5fccf315d6ba770065568015a8ce 100644 (file)
@@ -47,7 +47,7 @@ Reverse::run (boost::shared_ptr<AudioRegion> 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<AudioRegion> 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<AudioRegion> 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<AudioRegion> 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<AudioRegion> region)
 
   out:
 
-       delete [] buf;
+       if (buf) {
+               delete [] buf;
+       }
 
        if (ret) {
                for (si = nsrcs.begin(); si != nsrcs.end(); ++si) {