diff options
author | David Robillard <d@drobilla.net> | 2009-10-14 23:45:06 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-10-14 23:45:06 +0000 |
commit | 39ad06f03bed5d434e1738ccaf4c8ab76f86649b (patch) | |
tree | b61ff4c4cf4b1765be8fc151ef7ecd72acd6891c /libs/ardour | |
parent | 12598155a2fa07471ac1ec0453ce2b2e160e8921 (diff) |
Fix crash on MIDI import.
git-svn-id: svn://localhost/ardour2/branches/3.0@5784 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/import.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/ardour/import.cc b/libs/ardour/import.cc index 94d26ed4da..346773bc5f 100644 --- a/libs/ardour/import.cc +++ b/libs/ardour/import.cc @@ -214,8 +214,7 @@ create_mono_sources_for_writing (const vector<string>& new_paths, Session& sess, uint samplerate, vector<boost::shared_ptr<Source> >& newfiles, nframes64_t /*timeline_position*/) { - for (vector<string>::const_iterator i = new_paths.begin(); - i != new_paths.end(); ++i) + for (vector<string>::const_iterator i = new_paths.begin(); i != new_paths.end(); ++i) { boost::shared_ptr<Source> source; @@ -432,12 +431,13 @@ Session::import_audiofiles (ImportStatus& status) get_best_session_directory_for_new_source (), channels); Sources newfiles; + nframes64_t natural_position = source ? source->natural_position() : 0; if (status.replace_existing_source) { fatal << "THIS IS NOT IMPLEMENTED YET, IT SHOULD NEVER GET CALLED!!! DYING!" << endl; status.cancel = !map_existing_mono_sources (new_paths, *this, frame_rate(), newfiles, this); } else { - status.cancel = !create_mono_sources_for_writing (new_paths, *this, frame_rate(), newfiles, source->natural_position()); + status.cancel = !create_mono_sources_for_writing (new_paths, *this, frame_rate(), newfiles, natural_position); } // copy on cancel/failure so that any files that were created will be removed below |