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
F103082507: D45312.diff
Wed, Nov 20, 5:25 PM
F103075448: D45312.id138953.diff
Wed, Nov 20, 2:59 PM
F103066347: D45312.id138965.diff
Wed, Nov 20, 12:00 PM
F103055203: D45312.id.diff
Wed, Nov 20, 8:37 AM
F103037946: D45312.diff
Wed, Nov 20, 3:18 AM
Unknown Object (File)
Tue, Nov 19, 5:56 AM
Unknown Object (File)
Fri, Nov 8, 8:12 AM
Unknown Object (File)
Fri, Nov 8, 7:14 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