13
0

Fix "when refilling, cannot write" disk-reader bug

This happened initially during session load.
The GUI thread performed a direct refill (blocking wait)

`Session::post_engine_init() -> Track::seek() -> DiskReader::seek() -> DiskReader::do_refill_with_alloc()`

while concurrently the butler thread does the same:

```
Session::butler_transport_work() -> Track::non_realtime_locate() -> Route::non_realtime_locate()
-> DiskIOProcessor::non_realtime_locate() -> DiskReader::seek() -> DiskReader::do_refill_with_alloc()
-> DiskReader::refill_audio()
```

We do not want the GUI to wait, so now we just request a locate
and let refill happen in the background.
This commit is contained in:
Robin Gareus 2022-08-11 18:54:10 +02:00
parent 7aef0cd191
commit 9453802248
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -401,17 +401,10 @@ Session::post_engine_init ()
set_clean ();
/* Now, finally, we can fill the playback buffers */
/* Now, finally, we can [ask the butler to] fill the playback buffers */
BootMessage (_("Filling playback buffers"));
boost::shared_ptr<RouteList> rl = routes.reader();
for (RouteList::iterator r = rl->begin(); r != rl->end(); ++r) {
boost::shared_ptr<Track> trk = boost::dynamic_pointer_cast<Track> (*r);
if (trk && !trk->is_private_route()) {
trk->seek (_transport_sample, true);
}
}
request_locate (transport_sample(), true);
reset_xrun_count ();
return 0;