diff options
author | Max Kellermann <max@duempel.org> | 2011-12-13 21:11:04 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-12-13 21:58:02 +0100 |
commit | e01df06cd7b4331436564942c931ed351fb4e76f (patch) | |
tree | 1e234c35d583a53c13267cd903bd276967182b5e /src | |
parent | 6584897b697e5392c5ef192054991d29aa791842 (diff) | |
download | mpd-e01df06cd7b4331436564942c931ed351fb4e76f.tar.gz mpd-e01df06cd7b4331436564942c931ed351fb4e76f.tar.xz mpd-e01df06cd7b4331436564942c931ed351fb4e76f.zip |
output/null: implement output_plugin method delay()
Diffstat (limited to 'src')
-rw-r--r-- | src/output/null_output_plugin.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/output/null_output_plugin.c b/src/output/null_output_plugin.c index 0865ae055..9d7588fff 100644 --- a/src/output/null_output_plugin.c +++ b/src/output/null_output_plugin.c @@ -79,6 +79,16 @@ null_close(struct audio_output *ao) timer_free(nd->timer); } +static unsigned +null_delay(struct audio_output *ao) +{ + struct null_data *nd = (struct null_data *)ao; + + return nd->sync && nd->timer->started + ? timer_delay(nd->timer) + : 0; +} + static size_t null_play(struct audio_output *ao, G_GNUC_UNUSED const void *chunk, size_t size, G_GNUC_UNUSED GError **error) @@ -91,9 +101,6 @@ null_play(struct audio_output *ao, G_GNUC_UNUSED const void *chunk, size_t size, if (!timer->started) timer_start(timer); - else - timer_sync(timer); - timer_add(timer, size); return size; @@ -116,6 +123,7 @@ const struct audio_output_plugin null_output_plugin = { .finish = null_finish, .open = null_open, .close = null_close, + .delay = null_delay, .play = null_play, .cancel = null_cancel, }; |