aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristos Margiolis <christos@FreeBSD.org>2026-04-07 15:44:34 +0000
committerChristos Margiolis <christos@FreeBSD.org>2026-04-07 15:44:34 +0000
commit66a82f5fa471b8eda018b7566c3725a6742dfc0c (patch)
treeb4f3b0cff55d1c1b47e0286da4936d95b3bc5de9
parent8b18fc456bb136112e166508a9182718cdd44be2 (diff)
sound: De-macro array definitions in chn_calclatency()
Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D56263
-rw-r--r--sys/dev/sound/pcm/channel.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
index 9b71d93ac7f9..0b940fe4e843 100644
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -1748,19 +1748,6 @@ round_blksz(u_int32_t v, int round)
* aggressively through possibly real time programming technique.
*
*/
-#define CHN_LATENCY_PBLKCNT_REF \
- {{1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 1}, \
- {1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 1}}
-#define CHN_LATENCY_PBUFSZ_REF \
- {{7, 9, 12, 13, 14, 15, 15, 15, 15, 15, 16}, \
- {11, 12, 13, 14, 15, 16, 16, 16, 16, 16, 17}}
-
-#define CHN_LATENCY_RBLKCNT_REF \
- {{9, 8, 7, 6, 5, 5, 4, 3, 2, 1, 1}, \
- {9, 8, 7, 6, 5, 5, 4, 3, 2, 1, 1}}
-#define CHN_LATENCY_RBUFSZ_REF \
- {{14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16}, \
- {15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 17}}
#define CHN_LATENCY_DATA_REF 192000 /* 48khz stereo 16bit ~ 48000 x 2 x 2 */
@@ -1768,14 +1755,22 @@ static int
chn_calclatency(int dir, int latency, int bps, u_int32_t datarate,
u_int32_t max, int *rblksz, int *rblkcnt)
{
- static int pblkcnts[CHN_LATENCY_PROFILE_MAX + 1][CHN_LATENCY_MAX + 1] =
- CHN_LATENCY_PBLKCNT_REF;
- static int pbufszs[CHN_LATENCY_PROFILE_MAX + 1][CHN_LATENCY_MAX + 1] =
- CHN_LATENCY_PBUFSZ_REF;
- static int rblkcnts[CHN_LATENCY_PROFILE_MAX + 1][CHN_LATENCY_MAX + 1] =
- CHN_LATENCY_RBLKCNT_REF;
- static int rbufszs[CHN_LATENCY_PROFILE_MAX + 1][CHN_LATENCY_MAX + 1] =
- CHN_LATENCY_RBUFSZ_REF;
+ static int pblkcnts[CHN_LATENCY_PROFILE_MAX + 1][CHN_LATENCY_MAX + 1] = {
+ {1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 1},
+ {1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 1}
+ };
+ static int pbufszs[CHN_LATENCY_PROFILE_MAX + 1][CHN_LATENCY_MAX + 1] = {
+ {7, 9, 12, 13, 14, 15, 15, 15, 15, 15, 16},
+ {11, 12, 13, 14, 15, 16, 16, 16, 16, 16, 17}
+ };
+ static int rblkcnts[CHN_LATENCY_PROFILE_MAX + 1][CHN_LATENCY_MAX + 1] = {
+ {9, 8, 7, 6, 5, 5, 4, 3, 2, 1, 1},
+ {9, 8, 7, 6, 5, 5, 4, 3, 2, 1, 1}
+ };
+ static int rbufszs[CHN_LATENCY_PROFILE_MAX + 1][CHN_LATENCY_MAX + 1] = {
+ {14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16},
+ {15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 17}
+ };
u_int32_t bufsz;
int lprofile, blksz, blkcnt;