include/nuttx/audio/audio.h: Change member samp of apb to pointer so driver can customize sample buffer allocation

This commit is contained in:
ZhongAn 2018-08-27 07:45:27 -06:00 committed by Gregory Nutt
parent 7d734b52bd
commit 4d115e925f
2 changed files with 2 additions and 1 deletions

View File

@ -377,7 +377,7 @@ begin_packed_struct struct ap_buffer_s
sem_t sem; /* Reference locking semaphore */
uint16_t flags; /* Buffer flags */
uint16_t crefs; /* Number of reference counts */
uint8_t samp[0]; /* Offset of the first sample */
FAR uint8_t *samp; /* Offset of the first sample */
} end_packed_struct;
/* Structure defining the messages passed to a listening audio thread

View File

@ -130,6 +130,7 @@ int apb_alloc(FAR struct audio_buf_desc_s *bufdesc)
apb->nmaxbytes = bufdesc->numbytes;
apb->nbytes = 0;
apb->flags = 0;
apb->samp = (FAR uint8_t *)(apb + 1);
#ifdef CONFIG_AUDIO_MULTI_SESSION
apb->session = bufdesc->session;
#endif