diff options
author | David Robillard <d@drobilla.net> | 2006-06-21 18:14:45 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-06-21 18:14:45 +0000 |
commit | 13532c8500dce5f7a4525bcdfc3b44936fbaa5e6 (patch) | |
tree | 6877b3c3122968665454cd1a1cbb104151c5b788 /libs/ardour/sndfilesource.cc | |
parent | 6a1f2919f20286b7d51de8e9c02107ab42f8e763 (diff) |
Merged with trunk
git-svn-id: svn://localhost/ardour2/branches/midi@628 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/sndfilesource.cc')
-rw-r--r-- | libs/ardour/sndfilesource.cc | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc index 6929385141..6ea0929ae0 100644 --- a/libs/ardour/sndfilesource.cc +++ b/libs/ardour/sndfilesource.cc @@ -81,8 +81,6 @@ SndFileSource::SndFileSource (string idstr, SampleFormat sfmt, HeaderFormat hf, init (idstr); - cerr << "creating " << idstr << " hf = " << hf << endl; - switch (hf) { case CAF: fmt = SF_FORMAT_CAF; @@ -174,7 +172,7 @@ SndFileSource::SndFileSource (string idstr, SampleFormat sfmt, HeaderFormat hf, } if (_build_peakfiles) { - if (initialize_peakfile (false, _path)) { + if (initialize_peakfile (true, _path)) { sf_close (sf); sf = 0; throw failed_constructor (); @@ -187,14 +185,6 @@ SndFileSource::SndFileSource (string idstr, SampleFormat sfmt, HeaderFormat hf, HeaderPositionOffsetChanged.connect (mem_fun (*this, &AudioFileSource::handle_header_position_change)); } - if (_build_peakfiles) { - if (initialize_peakfile (false, _path)) { - sf_close (sf); - sf = 0; - throw failed_constructor (); - } - } - AudioSourceCreated (this); /* EMIT SIGNAL */ } @@ -310,7 +300,7 @@ SndFileSource::read_unlocked (Sample *dst, jack_nframes_t start, jack_nframes_t if (file_cnt) { - if (sf_seek (sf, (off_t) start, SEEK_SET) < 0) { + if (sf_seek (sf, (sf_count_t) start, SEEK_SET|SFM_READ) != (sf_count_t) start) { char errbuf[256]; sf_error_str (0, errbuf, sizeof (errbuf) - 1); error << string_compose(_("SndFileSource: could not seek to frame %1 within %2 (%3)"), start, _name.substr (1), errbuf) << endmsg; @@ -505,7 +495,7 @@ SndFileSource::set_header_timeline_position () jack_nframes_t SndFileSource::write_float (Sample* data, jack_nframes_t frame_pos, jack_nframes_t cnt) { - if (sf_seek (sf, frame_pos, SEEK_SET) != frame_pos) { + if (sf_seek (sf, frame_pos, SEEK_SET|SFM_WRITE) != frame_pos) { error << string_compose (_("%1: cannot seek to %2"), _path, frame_pos) << endmsg; return 0; } |