From ec4fd9fd88a10bfc88154e8e6791d5d69858a2e5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 28 Feb 2009 20:43:23 +0100 Subject: output: use GTimer instead of time_t for reopen after failure time() is not a monotonic timer, and MPD might get confused by clock skews. clock_gettime() provides a monotonic clock, but is not portable to non-POSIX systems (i.e. Windows). This patch uses GLib's GTimer API, which aims to be portable. --- src/output_internal.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/output_internal.h') diff --git a/src/output_internal.h b/src/output_internal.h index c5ed7652..498f45d0 100644 --- a/src/output_internal.h +++ b/src/output_internal.h @@ -65,10 +65,11 @@ struct audio_output { bool open; /** - * If not zero, the device has failed, and should not be - * reopened automatically before this time stamp. + * If not NULL, the device has failed, and this timer is used + * to estimate how long it should stay disabled (unless + * explicitly reopened with "play"). */ - time_t reopen_after; + GTimer *fail_timer; /** * The audio_format in which audio data is received from the -- cgit v1.2.3