From bc89fe0147c04b67141936d109c00dfd4d69cc4b Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 12 Dec 2008 14:43:24 +0000 Subject: most of the 2.X->3.0 commit (up to rev 4299) except for gtk2_ardour/editor_canvas.cc; builds and runs and does a few specific things but expect it to be buggy for a while yet git-svn-id: svn://localhost/ardour2/branches/3.0@4313 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/sndfilesource.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libs/ardour/sndfilesource.cc') diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc index 097f0c235d..6a4b5e325d 100644 --- a/libs/ardour/sndfilesource.cc +++ b/libs/ardour/sndfilesource.cc @@ -317,7 +317,12 @@ SndFileSource::read_unlocked (Sample *dst, nframes_t start, nframes_t cnt) const if (_info.channels == 1) { nframes_t ret = sf_read_float (sf, dst, file_cnt); - _read_data_count = cnt * sizeof(float); + _read_data_count = ret * sizeof(float); + if (ret != file_cnt) { + char errbuf[256]; + sf_error_str (0, errbuf, sizeof (errbuf) - 1); + cerr << string_compose(_("SndFileSource: @ %1 could not read %2 within %3 (%4) (len = %5)"), start, file_cnt, _name.substr (1), errbuf, _length) << endl; + } return ret; } } @@ -381,7 +386,7 @@ SndFileSource::nondestructive_write_unlocked (Sample *data, nframes_t cnt) } _write_data_count = cnt; - + return cnt; } -- cgit v1.2.3