From 076542f3177f2d1def04785fd52f5a5084ef0e27 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 23 Dec 2012 04:37:36 +0000 Subject: fix "import at file position" when copying or channel-splitting files on import. git-svn-id: svn://localhost/ardour2/branches/3.0@13711 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/sndfilesource.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libs/ardour/sndfilesource.cc') diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc index ca2544054c..3dfec0bab6 100644 --- a/libs/ardour/sndfilesource.cc +++ b/libs/ardour/sndfilesource.cc @@ -221,6 +221,13 @@ SndFileSource::open () bool bwf_info_exists = _broadcast_info->load_from_file (sf); + if (_file_is_new && _length == 0 && writable() && !bwf_info_exists) { + /* newly created files will not have a BWF header at this point in time. + * Import will have called Source::set_timeline_position() if one exists + * in the original. */ + header_position_offset = _timeline_position; + } + /* Set our timeline position to either the time reference from a BWF header or the current start of the session. */ -- cgit v1.2.3