mirror of
https://github.com/apache/nuttx.git
synced 2026-08-07 13:37:18 +00:00
The upper->periods >= upper->nbuffers check sat at the top of audio_allocbuffer(), but upper->periods is only incremented for shared ring requests (u.pbuffer == NULL), so for private buffer callers the check degenerated into "nbuffers == 0" and rejected every allocation when the lower half does not implement AUDIOIOC_GETBUFFERINFO, which is the only place nbuffers is ever assigned. Move the guard inside the shared ring branch so private buffers, which never enter upper->apbs[] and are unrelated to the ring depth, stay allocatable. The zero return value is kept as-is because a second application attaching to the same device relies on it to skip allocation and go straight to AUDIOIOC_ENQUEUEBUFFER. Signed-off-by: fangyibo <fangyibo@xiaomi.com> |
||
|---|---|---|
| .. | ||
| audio.c | ||
| audio_comp.c | ||
| CMakeLists.txt | ||
| Kconfig | ||
| Makefile | ||
| pcm_decode.c | ||