Page MenuHomeFreeBSD

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

Authored by christos on Wed, May 22, 11:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 25, 4:47 PM
Unknown Object (File)
Sat, May 25, 1:49 PM
Unknown Object (File)
Thu, May 23, 4:33 PM
Unknown Object (File)
Thu, May 23, 9:20 AM
Unknown Object (File)
Thu, May 23, 3:54 AM
Unknown Object (File)
Thu, May 23, 3:17 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().Thu, May 23, 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.Thu, May 23, 12:32 AM