Page MenuHomeFreeBSD

sound: Fix minchn, maxchn and fmts in sndstat_get_caps()
ClosedPublic

Authored by christos on May 22 2024, 11:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 23, 9:23 PM
Unknown Object (File)
Thu, Mar 20, 2:46 PM
Unknown Object (File)
Thu, Mar 20, 1:15 AM
Unknown Object (File)
Feb 19 2025, 3:44 AM
Unknown Object (File)
Feb 3 2025, 12:34 AM
Unknown Object (File)
Jan 29 2025, 1:33 AM
Unknown Object (File)
Jan 28 2025, 2:53 PM
Unknown Object (File)
Jan 24 2025, 9:28 AM
Subscribers

Details

Summary

The current implementation (incorrectly) passes the channel encoding
value to AFMT_CHANNEL(), which will always return 0, since the channel
number bits are masked out by AFMT_ENCODING().

Also add missing fmts initialization and aggregate encoding formats
into it directly.

Sponsored by: The FreeBSD Foundation
MFC after: 1 day

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/dev/sound/pcm/sndstat.c
354

We should aggregate the encoding formats into *fmts here, it will be left (and used) uninitialized otherwise. And yes, it wasn't initialized in the original code either, let's fix that.

christos retitled this revision from sound: Fix min and max channel counting in sndstat_get_caps() to sound: Fix minchn, maxchn and fmts in sndstat_get_caps().May 23 2024, 12:11 AM
christos edited the summary of this revision. (Show Details)
christos marked an inline comment as done.

Address Florian's comment.

This revision is now accepted and ready to land.May 23 2024, 12:32 AM