mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 08:25:38 +00:00
sdl: sync tail pointer in SDL_Audio backend
SDL uses the Audio_out session in streaming fashion. For this reason the audio might be played with delay of at most the queue size. To mitigate the effect we synchronize the tail pointer to the current play pointer when the PlayAudio() function is called by SDL for the first time. Fixes #1612.
This commit is contained in:
parent
89255c3979
commit
e6995ecad7
@ -186,6 +186,18 @@ static void GENODEAUD_WaitAudio(_THIS)
|
||||
|
||||
static void GENODEAUD_PlayAudio(_THIS)
|
||||
{
|
||||
/*
|
||||
* Synchronize the play pointer when this function is first called
|
||||
*/
|
||||
static bool initial_reset = true;
|
||||
if (initial_reset) {
|
||||
for (int channel = 0; channel < AUDIO_CHANNELS; channel++) {
|
||||
Audio_out::Connection *connection = _this->hidden->audio[channel];
|
||||
connection->stream()->reset();
|
||||
}
|
||||
initial_reset = false;
|
||||
}
|
||||
|
||||
Audio_out::Packet *p[AUDIO_CHANNELS];
|
||||
|
||||
for (int channel = 0; channel < AUDIO_CHANNELS; channel++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user