forward port 2.X various changes (not all, but i have a list) ending with 6928
[ardour.git] / libs / ardour / audiosource.cc
index f309f599c5f199ab76ffb6ae7e2e3b63e973bc9c..083cf3bea903273d1f203bf2d2f2ccdeed794861 100644 (file)
@@ -945,3 +945,14 @@ AudioSource::available_peaks (double zoom_factor) const
        return (end/sizeof(PeakData)) * _FPP;
 }
 
+void
+AudioSource::dec_read_data_count (nframes_t cnt)
+{
+        uint32_t val = cnt * sizeof (Sample);
+
+        if (val < _read_data_count) {
+                _read_data_count -= val;
+        } else { 
+                _read_data_count = 0;
+        }
+}