alsa: handle old alsa version

Out Ubuntu CI seems to have an older alsa version that doesn't have
snd_pcm_channel_area_addr so include it here.
This commit is contained in:
Wim Taymans 2023-04-14 19:25:51 +02:00
parent a8770d501c
commit 381283ad81
2 changed files with 13 additions and 3 deletions

View file

@ -353,6 +353,16 @@ static inline int ratelimit_test(struct ratelimit *r, uint64_t now)
return missed;
}
#if defined(SND_LIB_VER)
#if SND_LIB_VERSION >= SND_LIB_VER(1, 2, 6)
#define channel_area_addr snd_pcm_channel_area_addr
#else
static inline void *channel_area_addr(const snd_pcm_channel_area_t *area, snd_pcm_uframes_t offset)
{
return (char *)area->addr + (area->first + area->step * offset) / 8;
}
#endif
#endif
#ifdef __cplusplus
} /* extern "C" */