output/httpd: implement delay()

This commit is contained in:
Max Kellermann 2010-11-05 09:42:14 +01:00
parent e11ff967d0
commit 90dc880e67
2 changed files with 12 additions and 3 deletions

2
NEWS
View File

@ -65,7 +65,7 @@ ver 0.16 (20??/??/??)
- httpd: bind_to_address support (including IPv6) - httpd: bind_to_address support (including IPv6)
- oss: 24 bit support via OSS4 - oss: 24 bit support via OSS4
- win32: new output plugin for Windows Wave - win32: new output plugin for Windows Wave
- shout: more responsive to control commands - shout, httpd: more responsive to control commands
- wildcards allowed in audio_format configuration - wildcards allowed in audio_format configuration
- consistently lock audio output objects - consistently lock audio output objects
* player: * player:

View File

@ -375,6 +375,16 @@ httpd_output_send_header(struct httpd_output *httpd,
httpd_client_send(client, httpd->header); httpd_client_send(client, httpd->header);
} }
static unsigned
httpd_output_delay(void *data)
{
struct httpd_output *httpd = data;
return httpd->timer->started
? timer_delay(httpd->timer)
: 0;
}
static void static void
httpd_client_check_queue(gpointer data, G_GNUC_UNUSED gpointer user_data) httpd_client_check_queue(gpointer data, G_GNUC_UNUSED gpointer user_data)
{ {
@ -464,8 +474,6 @@ httpd_output_play(void *data, const void *chunk, size_t size, GError **error)
if (!httpd->timer->started) if (!httpd->timer->started)
timer_start(httpd->timer); timer_start(httpd->timer);
else
timer_sync(httpd->timer);
timer_add(httpd->timer, size); timer_add(httpd->timer, size);
return size; return size;
@ -575,6 +583,7 @@ const struct audio_output_plugin httpd_output_plugin = {
.disable = httpd_output_disable, .disable = httpd_output_disable,
.open = httpd_output_open, .open = httpd_output_open,
.close = httpd_output_close, .close = httpd_output_close,
.delay = httpd_output_delay,
.send_tag = httpd_output_tag, .send_tag = httpd_output_tag,
.play = httpd_output_play, .play = httpd_output_play,
.pause = httpd_output_pause, .pause = httpd_output_pause,