Fix FLAC decoder lock contention.
The FLAC decoder is doing everything with the lock held, so the only time it ever releases the lock when playing is for a few cycles between each loop. This prevents other threads from ever acquiring the lock. This can cause other threads to wait for the lock indefinitely. Handle decoding like the other decoder classes: do the brief read and decode with the lock held, then release the lock while making the blocking call to write data to the audio sink. Fixes media player ANRs with NORMALIZED_SLEEPER=0, and generally unresponsive media API calls in any case when this decoder is in use.
Loading
Please register or sign in to comment