NO-OP: whitespace
[ardour.git] / libs / ardour / disk_reader.cc
index 98643f8ebdbda22dea8240eac044e944edf16c4f..55180ad1bdd546aeee3049306b75ae9e32080bba 100644 (file)
@@ -17,6 +17,8 @@
 
 */
 
+#include <boost/smart_ptr/scoped_ptr.hpp>
+
 #include "pbd/enumwriter.h"
 #include "pbd/memento_command.h"
 
@@ -251,11 +253,6 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
                }
        }
 
-       if (c->empty()) {
-               /* do nothing */
-               return;
-       }
-
        if ((speed == 0.0) && (ms == MonitoringDisk)) {
                /* no channels, or stopped. Don't accidentally pass any data
                 * from disk into our outputs (e.g. via interpolation)
@@ -263,6 +260,14 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
                return;
        }
 
+       BufferSet& scratch_bufs (_session.get_scratch_buffers (bufs.count()));
+       const bool still_locating = _session.global_locate_pending();
+
+       if (c->empty()) {
+               /* do nothing with audio */
+               goto midi;
+       }
+
        if (speed != 1.0f && speed != -1.0f) {
                interpolation.set_speed (speed);
                disk_samples_to_consume = interpolation.distance (nframes);
@@ -273,8 +278,6 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
                disk_samples_to_consume = nframes;
        }
 
-       BufferSet& scratch_bufs (_session.get_scratch_buffers (bufs.count()));
-       const bool still_locating = _session.global_locate_pending();
 
        if (!result_required || ((ms & MonitoringDisk) == 0) || still_locating || _no_disk_output) {
 
@@ -363,12 +366,12 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
 
                                        if (fabsf (speed) != 1.0f) {
                                                samplecnt_t ocnt = nframes;
-                                               samplecnt_t icnt = interpolation.interpolate (n, chaninfo->rw_vector.len[0], chaninfo->rw_vector.buf[0], ocnt, disk_signal);
+                                               interpolation.interpolate (n, chaninfo->rw_vector.len[0], chaninfo->rw_vector.buf[0], ocnt, disk_signal);
 
                                                if (ocnt < nframes) {
                                                        disk_signal += ocnt;
                                                        ocnt = nframes - ocnt;
-                                                       icnt = interpolation.interpolate (n, chaninfo->rw_vector.len[1], chaninfo->rw_vector.buf[1], ocnt, disk_signal);
+                                                       interpolation.interpolate (n, chaninfo->rw_vector.len[1], chaninfo->rw_vector.buf[1], ocnt, disk_signal);
                                                }
 
                                        } else if (speed != 0.0) {
@@ -399,8 +402,6 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
 
                        chaninfo->buf->increment_read_ptr (disk_samples_to_consume);
 
-                 monitor_mix:
-
                        if (ms & MonitoringInput) {
                                /* mix the disk signal into the input signal (already in bufs) */
                                mix_buffers_no_gain (output.data(), disk_signal, disk_samples_to_consume);
@@ -544,8 +545,8 @@ DiskReader::overwrite_existing_buffers ()
                /* assume all are the same size */
                samplecnt_t size = c->front()->buf->bufsize();
 
-               std::auto_ptr<Sample> mixdown_buffer (new Sample[size]);
-               std::auto_ptr<float> gain_buffer (new float[size]);
+               boost::scoped_ptr<Sample> mixdown_buffer (new Sample[size]);
+               boost::scoped_ptr<float> gain_buffer (new float[size]);
 
                /* reduce size so that we can fill the buffer correctly (ringbuffers
                   can only handle size-1, otherwise they appear to be empty)
@@ -835,8 +836,8 @@ DiskReader::_do_refill_with_alloc (bool partial_fill)
        */
 
        {
-               std::auto_ptr<Sample> mix_buf (new Sample[2*1048576]);
-               std::auto_ptr<float>  gain_buf (new float[2*1048576]);
+               boost::scoped_ptr<Sample> mix_buf (new Sample[2*1048576]);
+               boost::scoped_ptr<float>  gain_buf (new float[2*1048576]);
 
                int ret = refill_audio (mix_buf.get(), gain_buf.get(), (partial_fill ? _chunk_samples : 0));