static bool
httpd_output_pause(struct audio_output *ao)
{
	struct httpd_output *httpd = (struct httpd_output *)ao;

	if (httpd_output_lock_has_clients(httpd)) {
		static const char silence[1020];
		return httpd_output_play(ao, silence, sizeof(silence),
					 NULL) > 0;
	} else {
		return true;
	}
}
Beispiel #2
0
static bool
httpd_output_pause(struct audio_output *ao)
{
	struct httpd_output *httpd = (struct httpd_output *)ao;

	g_mutex_lock(httpd->mutex);
	bool has_clients = httpd->clients != NULL;
	g_mutex_unlock(httpd->mutex);

	if (has_clients) {
		static const char silence[1020];
		return httpd_output_play(ao, silence, sizeof(silence),
					 NULL) > 0;
	} else {
		g_usleep(100000);
		return true;
	}
}