mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-23 21:57:16 +01:00
fix another use of a reader lock by a source (comments explain more)
This commit is contained in:
parent
b74fb262fa
commit
f3bf91b9b1
1 changed files with 8 additions and 1 deletions
|
|
@ -308,7 +308,14 @@ AudioSource::read (Sample *dst, samplepos_t start, samplecnt_t cnt, int /*channe
|
|||
{
|
||||
assert (cnt >= 0);
|
||||
|
||||
ReaderLock lm (_lock);
|
||||
/* as odd as it may seem, given that this method is used to *read* the
|
||||
* source, that we would need a write lock here. The problem is that
|
||||
* the audio file API we use (libsndfile) does not allow concurrent use
|
||||
* of the same SNDFILE object, even for reading. Consequently, even
|
||||
* readers must be serialized.
|
||||
*/
|
||||
|
||||
WriterLock lm (_lock);
|
||||
return read_unlocked (dst, start, cnt);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue