diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2020-03-23 17:05:35 -0600 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2020-03-23 17:05:45 -0600 |
commit | b3a1cbbfa208d67432ac46209c46467700550a7f (patch) | |
tree | 36fb09477161556b48fb87cdfbad077c895e686f /libs/ardour/session_transport.cc | |
parent | c765079b2f7c5e369875c9f714f078dc0c16af90 (diff) |
add in timing for disk buffer reload after locate, to replace hard-coded 0.05 seconds per track
Leave debug output in place for now to get some numbers from any testers
Diffstat (limited to 'libs/ardour/session_transport.cc')
-rw-r--r-- | libs/ardour/session_transport.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 31392b9c89..caa88b4f3b 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -1268,6 +1268,9 @@ Session::non_realtime_locate () /* no more looping .. should have been noticed elsewhere */ } + microseconds_t start; + uint32_t nt = 0; + int hundreths_of_second_per_track = 0; samplepos_t tf; @@ -1277,14 +1280,21 @@ Session::non_realtime_locate () restart: gint sc = g_atomic_int_get (&_seek_counter); tf = _transport_sample; + start = get_microseconds (); - for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { + for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i, ++nt) { (*i)->non_realtime_locate (tf); if (sc != g_atomic_int_get (&_seek_counter)) { std::cerr << "\n\nLOCATE INTERRUPTED BY LOCATE!!!\n\n"; goto restart; } } + + microseconds_t end = get_microseconds (); + int usecs_per_track = lrintf ((end - start) / (double) nt); + if (usecs_per_track > g_atomic_int_get (¤t_usecs_per_track)) { + g_atomic_int_set (¤t_usecs_per_track, usecs_per_track); + } } { |