diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2019-09-20 14:11:07 -0600 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2019-09-22 12:23:54 -0600 |
commit | 057ce335635ebf87e5507f7d78379eb36cc66ef1 (patch) | |
tree | f58ecc401bb61acdba951f148eb5b046f5116f5b /libs | |
parent | 99c072660b1173c2d74c745e9958325cbbd8f7a3 (diff) |
use internal seek to implement DiskReader::seek() when possible.
This still needs a check that the amount of readable data left in the buffe is adequate.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/disk_reader.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/ardour/disk_reader.cc b/libs/ardour/disk_reader.cc index 083704d3d7..35a6c6c00c 100644 --- a/libs/ardour/disk_reader.cc +++ b/libs/ardour/disk_reader.cc @@ -598,10 +598,13 @@ DiskReader::seek (samplepos_t sample, bool complete_refill) g_atomic_int_set (&_pending_overwrite, 0); - //sample = std::max ((samplecnt_t)0, sample -_session.worst_output_latency ()); + DEBUG_TRACE (DEBUG::DiskIO, string_compose ("DiskReader::seek %s %ld -> %ld refill=%d\n", owner()->name().c_str(), playback_sample, sample, complete_refill)); - //printf ("DiskReader::seek %s %ld -> %ld refill=%d\n", owner()->name().c_str(), playback_sample, sample, complete_refill); - // TODO: check if we can micro-locate + const samplecnt_t distance = sample - playback_sample; + if (can_internal_playback_seek (distance)) { + internal_playback_seek (distance); + return 0; + } for (n = 0, chan = c->begin(); chan != c->end(); ++chan, ++n) { (*chan)->rbuf->reset (); |