From 77687519b69f39aaa2354f4c9945958fc1c630fe Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 15 Jul 2016 17:03:07 +0200 Subject: Refactor TmpFile into an abstract base class This allows a TmpFile pointer to be either a Sync or Async (Threaded) writer. As result we must be able to handle both RT and non RT processing. Still, post-processing (normalization and encoding) should always happen faster than realtime (freewheeling). Since jack does not allow a client to change to freewheeling from within the process-callback, the async-writer disk-thread FileFlushed is used to initiate post-processing. --- libs/ardour/export_handler.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libs/ardour/export_handler.cc') diff --git a/libs/ardour/export_handler.cc b/libs/ardour/export_handler.cc index 8ca73788dd..d83e2beebb 100644 --- a/libs/ardour/export_handler.cc +++ b/libs/ardour/export_handler.cc @@ -26,6 +26,7 @@ #include "pbd/convert.h" +#include "ardour/audioengine.h" #include "ardour/audiofile_tagger.h" #include "ardour/debug.h" #include "ardour/export_graph_builder.h" @@ -232,7 +233,12 @@ ExportHandler::process (framecnt_t frames) return 0; } else if (normalizing) { Glib::Threads::Mutex::Lock l (export_status->lock()); - return process_normalize (); + if (AudioEngine::instance()->freewheeling ()) { + return process_normalize (); + } else { + // wait until we're freewheeling + return 0; + } } else { Glib::Threads::Mutex::Lock l (export_status->lock()); return process_timespan (frames); -- cgit v1.2.3