From cd88bf91b8e312cea39e5a4055751bc71c267a9a Mon Sep 17 00:00:00 2001 From: Abramo Bagnara Date: Sun, 25 Feb 2001 11:54:05 +0000 Subject: [PATCH] Added timersub definition if missing --- aplay/aplay.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aplay/aplay.c b/aplay/aplay.c index 5cbab93..5eaacd3 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -818,6 +818,18 @@ static void set_params(void) // fprintf(stderr, "real chunk_size = %i, frags = %i, total = %i\n", chunk_size, setup.buf.block.frags, setup.buf.block.frags * chunk_size); } +#ifndef timersub +#define timersub(a, b, result) \ +do { \ + (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ + (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ + if ((result)->tv_usec < 0) { \ + --(result)->tv_sec; \ + (result)->tv_usec += 1000000; \ + } \ +} while (0) +#endif + /* playback write error hander */ void xrun(void) -- 2.47.1