diff options
author | David Robillard <d@drobilla.net> | 2008-10-07 17:33:05 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-10-07 17:33:05 +0000 |
commit | ff73f4e5e156569bb767313fbfa1ed2b579a6751 (patch) | |
tree | 719daefdbb2367e97a9e34c020d058ad301d93fd /libs | |
parent | d64ff6b659eeb5b552dd2f7c94011b75638060de (diff) |
Audio diskstream fix from torbenh.
git-svn-id: svn://localhost/ardour2/branches/3.0@3876 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/audio_diskstream.h | 1 | ||||
-rw-r--r-- | libs/ardour/audio_diskstream.cc | 12 | ||||
-rw-r--r-- | libs/ardour/session_transport.cc | 14 |
3 files changed, 15 insertions, 12 deletions
diff --git a/libs/ardour/ardour/audio_diskstream.h b/libs/ardour/ardour/audio_diskstream.h index aaf5461361..939587fbd8 100644 --- a/libs/ardour/ardour/audio_diskstream.h +++ b/libs/ardour/ardour/audio_diskstream.h @@ -166,6 +166,7 @@ class AudioDiskstream : public Diskstream int rename_write_sources (); void reset_write_sources (bool, bool force = false); void non_realtime_input_change (); + void non_realtime_locate (nframes_t location); protected: friend class Auditioner; diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index 2953c9e074..e9f4b9ea15 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -206,6 +206,18 @@ AudioDiskstream::non_realtime_input_change () } void +AudioDiskstream::non_realtime_locate (nframes_t location) +{ + /* now refill channel buffers */ + + if (speed() != 1.0f || speed() != -1.0f) { + seek ((nframes_t) (location * (double) speed())); + } else { + seek (location); + } +} + +void AudioDiskstream::get_input_sources () { boost::shared_ptr<ChannelList> c = channels.reader(); diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index cc94595f8c..7480ba49df 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -224,12 +224,7 @@ Session::butler_transport_work () for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) { if (!(*i)->hidden()) { - if ((*i)->speed() != 1.0f || (*i)->speed() != -1.0f) { - (*i)->seek ((nframes_t) (_transport_frame * (double) (*i)->speed())); - } - else { - (*i)->seek (_transport_frame); - } + (*i)->non_realtime_locate (_transport_frame); } if (on_entry != g_atomic_int_get (&butler_should_do_transport_work)) { /* new request, stop seeking, and start again */ @@ -434,12 +429,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished) for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) { if (!(*i)->hidden()) { - if ((*i)->speed() != 1.0f || (*i)->speed() != -1.0f) { - (*i)->seek ((nframes_t) (_transport_frame * (double) (*i)->speed())); - } - else { - (*i)->seek (_transport_frame); - } + (*i)->non_realtime_locate (_transport_frame); } if (on_entry != g_atomic_int_get (&butler_should_do_transport_work)) { finished = false; |