mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[client] audio: don't lock when consuming frames from the buffer
This commit is contained in:
parent
d6bbc4f89c
commit
4b080f7610
@ -133,8 +133,6 @@ void playbackStopNL(void)
|
|||||||
|
|
||||||
static int playbackPullFrames(uint8_t ** data, int frames)
|
static int playbackPullFrames(uint8_t ** data, int frames)
|
||||||
{
|
{
|
||||||
LG_LOCK(audio.playback.lock);
|
|
||||||
|
|
||||||
if (audio.playback.buffer)
|
if (audio.playback.buffer)
|
||||||
*data = ringbuffer_consume(audio.playback.buffer, &frames);
|
*data = ringbuffer_consume(audio.playback.buffer, &frames);
|
||||||
else
|
else
|
||||||
@ -142,9 +140,11 @@ static int playbackPullFrames(uint8_t ** data, int frames)
|
|||||||
|
|
||||||
if (audio.playback.state == STREAM_STATE_DRAIN &&
|
if (audio.playback.state == STREAM_STATE_DRAIN &&
|
||||||
ringbuffer_getCount(audio.playback.buffer) == 0)
|
ringbuffer_getCount(audio.playback.buffer) == 0)
|
||||||
|
{
|
||||||
|
LG_LOCK(audio.playback.lock);
|
||||||
playbackStopNL();
|
playbackStopNL();
|
||||||
|
LG_UNLOCK(audio.playback.lock);
|
||||||
LG_UNLOCK(audio.playback.lock);
|
}
|
||||||
return frames;
|
return frames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user