]> git.alsa-project.org Git - alsa-utils.git/commitdiff
Added timersub definition if missing
authorAbramo Bagnara <abramo@alsa-project.org>
Sun, 25 Feb 2001 11:54:05 +0000 (11:54 +0000)
committerAbramo Bagnara <abramo@alsa-project.org>
Sun, 25 Feb 2001 11:54:05 +0000 (11:54 +0000)
aplay/aplay.c

index 5cbab931e68b9406a6fd2be44d9e366dad424a38..5eaacd34dd96a746c441347f4ab239b7e0129b0c 100644 (file)
@@ -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)