]> git.alsa-project.org Git - alsa-lib.git/commitdiff
pcm: hw: fix default timestamp type for O_APPPEND
authorJaroslav Kysela <perex@perex.cz>
Mon, 7 Apr 2025 16:52:17 +0000 (18:52 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 7 Apr 2025 16:53:02 +0000 (18:53 +0200)
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 <perex@perex.cz>
src/pcm/pcm_hw.c

index c99b186aa010797155f74861de05f2918a7d2af0..ab5e45eee4546ad310b284f62e0687c3b846cd1d 100644 (file)
@@ -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) {