output_all: synchronize playback with a notify object
Use audio_output_client_notify instead of g_usleep(1ms) in audio_output_all_wait() to synchronize with the output_thread. Signal the audio_output_client_notify object in ao_play().
This commit is contained in:
parent
933fcf4232
commit
3be1cdf8e0
@ -414,8 +414,7 @@ audio_output_all_wait(unsigned threshold)
|
|||||||
if (audio_output_all_check() < threshold)
|
if (audio_output_all_check() < threshold)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
/* XXX synchronize in a better way */
|
notify_wait(&audio_output_client_notify);
|
||||||
g_usleep(1000);
|
|
||||||
|
|
||||||
return audio_output_all_check() < threshold;
|
return audio_output_all_check() < threshold;
|
||||||
}
|
}
|
||||||
|
@ -155,6 +155,8 @@ static void ao_play(struct audio_output *ao)
|
|||||||
|
|
||||||
ao->chunk_finished = true;
|
ao->chunk_finished = true;
|
||||||
g_mutex_unlock(ao->mutex);
|
g_mutex_unlock(ao->mutex);
|
||||||
|
|
||||||
|
notify_signal(&audio_output_client_notify);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ao_pause(struct audio_output *ao)
|
static void ao_pause(struct audio_output *ao)
|
||||||
|
Loading…
Reference in New Issue
Block a user