summaryrefslogtreecommitdiff
path: root/libs/ardour/import.cc
diff options
context:
space:
mode:
authorJohn Emmas <johne53@tiscali.co.uk>2013-08-09 17:56:14 +0100
committerJohn Emmas <johne53@tiscali.co.uk>2013-08-09 17:56:14 +0100
commit5f703f25a9c73912d2d28c29c52130e5f363c768 (patch)
treea3bdba0ab67a167e8601b626bed41ad002b3f834 /libs/ardour/import.cc
parent64cc518e72c684f05a3dc48d97ec985fbe6186d1 (diff)
'libs/ardour' - If the platform is Windows, prevent lengthy caching by flushing imported files on completion of the import
Diffstat (limited to 'libs/ardour/import.cc')
-rw-r--r--libs/ardour/import.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/ardour/import.cc b/libs/ardour/import.cc
index 9be72a9966..b66f354224 100644
--- a/libs/ardour/import.cc
+++ b/libs/ardour/import.cc
@@ -334,6 +334,14 @@ write_audio_data_to_new_files (ImportableSource* source, ImportStatus& status,
uint32_t chn;
if ((nread = source->read (data.get(), nframes)) == 0) {
+#ifdef PLATFORM_WINDOWS
+ /* Flush the data once we've finished importing the file. Windows can */
+ /* cache the data for very long periods of time (perhaps not writing */
+ /* it to disk until Ardour closes). So let's force it to flush now. */
+ for (chn = 0; chn < channels; ++chn)
+ if ((afs = boost::dynamic_pointer_cast<AudioFileSource>(newfiles[chn])) != 0)
+ afs->flush ();
+#endif
break;
}