summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-09-30 13:02:50 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-09-30 13:02:58 -0400
commit71343e835aad84288d86f02fc5a3afdd4d1942d9 (patch)
tree3db25596263803bdf215e0fa51bed8638cb78f84
parent7ff47ab80ef91849d79823c18a530ac717b2c53e (diff)
change the logic for a capture buffer flush to disk when a locate is occuring
We can't check for Session::actively_recording() because punch out may have disabled that. Rather than add logic to check if a flush is needed (which is not much different than the code that runs as part of the flush to disk), just do a flush anyway.
-rw-r--r--libs/ardour/session_transport.cc23
1 files changed, 16 insertions, 7 deletions
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index 3b2060d2ac..86ab62e1ef 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -314,6 +314,8 @@ Session::realtime_locate ()
void
Session::butler_transport_work ()
{
+ /* Note: this function executes in the butler thread context */
+
restart:
bool finished;
PostTransportWork ptw;
@@ -329,20 +331,27 @@ Session::butler_transport_work ()
if (ptw & PostTransportLocate) {
- if (get_play_loop() && !Config->get_seamless_loop() && actively_recording()) {
+ if (get_play_loop() && !Config->get_seamless_loop()) {
- /* this locate is happening while we are doing loop
- * recording but with seam-ed (non-seamless) looping.
- * We must flush any data to disk before resetting
- * buffers as part of the pending locate (which happens
- * a little later in this method).
+ DEBUG_TRACE (DEBUG::Butler, "flush loop recording fragment to disk\n");
+
+ /* this locate might be happening while we are
+ * loop recording.
+ *
+ * Non-seamless looping will require a locate (below) that
+ * will reset capture buffers and throw away data.
+ *
+ * Rather than first find all tracks and see if they
+ * have outstanding data, just do a flush anyway. It
+ * may be cheaper this way anyway, and is certainly
+ * more accurate.
*/
bool more_disk_io_to_do = false;
uint32_t errors = 0;
do {
- more_disk_io_to_do = _butler->flush_tracks_to_disk (r, errors, true);
+ more_disk_io_to_do = _butler->flush_tracks_to_disk_after_locate (r, errors);
if (errors) {
break;