From 15f2b276121b0acbdfdf32035f721c8e58a9114e Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 7 Apr 2025 18:52:17 +0200 Subject: [PATCH] pcm: hw: fix default timestamp type for O_APPPEND Fixes: 7e01443e ("pcm: hw: do not reset tstamp_type in SND_PCM_APPEND mode") Link: https://github.com/alsa-project/alsa-lib/pull/450 Signed-off-by: Jaroslav Kysela --- src/pcm/pcm_hw.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c index c99b186a..ab5e45ee 100644 --- a/src/pcm/pcm_hw.c +++ b/src/pcm/pcm_hw.c @@ -1689,6 +1689,12 @@ int snd_pcm_hw_open_fd(snd_pcm_t **pcmp, const char *name, int fd, } } } +#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) + else { + /* the first stream already sets this */ + tstamp_type = SND_PCM_TSTAMP_TYPE_MONOTONIC; + } +#endif hw = calloc(1, sizeof(snd_pcm_hw_t)); if (!hw) { -- 2.47.1