Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 9fdcb0a9 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Fix theoretical race using TrackBase::sampleRate()

In two places we assumed that TrackBase::sampleRate() would return the
same value when it is called twice in the same function.  This is not
guaranteed; sampleRate() reads from the control block so the return
value could change.  To fix this, only call sampleRate() once and cache
the return value to get a consistent value.

This was only a theoretical race.  In MixerThread::prepareTracks_l()
it would have no bad effect.  In TimedTrack::getNextBuffer() it could
cause a real problem, but we don't currently support dynamic sample rate
ratios for timed tracks.

Change-Id: I8e5c33f0121fc058d1e70c2ab5e9135397d3e0b7
parent 7919fa2c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment