permit different sizes for audio playback & capture buffers
[ardour.git] / libs / ardour / audio_track.cc
index 862f15b68cc2fd5f5b923e714187d758b77b0611..fcd211375aed7f80cd58bfd4527e3c60d4173c3a 100644 (file)
@@ -351,20 +351,18 @@ int
 AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame, int declick,
                  bool can_record, bool rec_monitors_input, bool& need_butler)
 {
+       Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
+       if (!lm.locked()) {
+               return 0;
+       }
+
        int dret;
        Sample* b;
        Sample* tmpb;
        nframes_t transport_frame;
        boost::shared_ptr<AudioDiskstream> diskstream = audio_diskstream();
         
-       {
-               Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
-               if (lm.locked()) {
-                       // automation snapshot can also be called from the non-rt context
-                       // and it uses the redirect list, so we take the lock out here
-                       automation_snapshot (start_frame, false);
-               }
-       }
+       automation_snapshot (start_frame, false);
 
        if (n_outputs().n_total() == 0 && _processors.empty()) {
                return 0;
@@ -527,7 +525,7 @@ int
 AudioTrack::export_stuff (BufferSet& buffers, sframes_t start, nframes_t nframes, bool enable_processing)
 {
        boost::scoped_array<gain_t> gain_buffer (new gain_t[nframes]);
-       boost::scoped_array<float> mix_buffer (new float[nframes]);
+       boost::scoped_array<Sample> mix_buffer (new Sample[nframes]);
        boost::shared_ptr<AudioDiskstream> diskstream = audio_diskstream();
 
        Glib::RWLock::ReaderLock rlock (_processor_lock);