diff options
author | Robin Gareus <robin@gareus.org> | 2019-02-21 16:10:45 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-02-21 16:10:45 +0100 |
commit | 800605727903812e01f0b4502907625f0b1221ba (patch) | |
tree | 55c49ff8972dca55e726fa0ebaf7756787c893ef | |
parent | 522f28b3c5b5e93b924ef05cf64368a5a1a033ad (diff) |
Avoid dynamic-cast, prefer virtual inheritance for performance reasons
-rw-r--r-- | libs/ardour/ardour/route.h | 1 | ||||
-rw-r--r-- | libs/ardour/session_transport.cc | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 24f3f998fc..576578b961 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -148,6 +148,7 @@ public: int silent_roll (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool& need_butler); + virtual bool declick_in_progress () const { return false; } virtual bool can_record() { return false; } void non_realtime_transport_stop (samplepos_t now, bool flush); diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index ff8aaa101e..ad24623776 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -583,8 +583,7 @@ Session::declick_in_progress () const { boost::shared_ptr<RouteList> rl = routes.reader(); for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { - boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i); - if (tr && tr->declick_in_progress ()) { + if ((*i)->declick_in_progress ()) { return true; } } |