diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2007-11-15 02:32:11 +0000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2007-11-15 02:32:11 +0000 |
commit | 20d6a70b15b58e1fa6d4df1a3b72aeef00f37908 (patch) | |
tree | 2dc7df6fabe52a0e597ac660efe54b1e4cd0f85c /libs | |
parent | 7976efd071e5aca7c873ddb707a026228a5c1413 (diff) |
Simplify finalization code in Session::import_audiofile
git-svn-id: svn://localhost/ardour2/trunk@2670 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/import.cc | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/libs/ardour/import.cc b/libs/ardour/import.cc index 14dea2aed5..82571e157c 100644 --- a/libs/ardour/import.cc +++ b/libs/ardour/import.cc @@ -162,7 +162,6 @@ Session::import_audiofile (import_status& status) string basepath; int ret = -1; vector<string> new_paths; - struct tm* now; uint32_t cnt = 1; status.sources.clear (); @@ -238,27 +237,26 @@ Session::import_audiofile (import_status& status) } } - status.freeze = true; - - time_t xnow; - time (&xnow); - now = localtime (&xnow); + if (!status.cancel) { + struct tm* now; + time_t xnow; + time (&xnow); + now = localtime (&xnow); + status.freeze = true; - /* flush the final length(s) to the header(s) */ + /* flush the final length(s) to the header(s) */ - for (SourceList::iterator x = status.sources.begin(); x != status.sources.end() && !status.cancel; ++x) { - boost::dynamic_pointer_cast<AudioFileSource>(*x)->update_header(0, *now, xnow); - boost::dynamic_pointer_cast<AudioSource>(*x)->done_with_peakfile_writes (); - } + for (SourceList::iterator x = status.sources.begin(); x != status.sources.end(); ++x) { + boost::dynamic_pointer_cast<AudioFileSource>(*x)->update_header(0, *now, xnow); + boost::dynamic_pointer_cast<AudioSource>(*x)->done_with_peakfile_writes (); + } - /* save state so that we don't lose these new Sources */ + /* save state so that we don't lose these new Sources */ - if (!status.cancel) { save_state (_name); + ret = 0; } - ret = 0; - out: if (status.cancel) { |