mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
nuttx/audio: clear apb buffer when playback dequeue
memset apb buffer to zero when dequeue Signed-off-by: yangyalei <yangyalei@xiaomi.com>
This commit is contained in:
parent
b13defe9e4
commit
854cd0ca21
2 changed files with 13 additions and 10 deletions
|
|
@ -477,6 +477,7 @@ static int audio_configure(FAR struct file *filep,
|
|||
/* INPUT/OUTPUT configure success here */
|
||||
|
||||
audio_setstate(upper, AUDIO_STATE_PREPARED);
|
||||
upper->info.type = caps->ac_type;
|
||||
upper->info.format = caps->ac_subtype;
|
||||
upper->info.channels = caps->ac_channels;
|
||||
upper->info.subformat = caps->ac_format.b[0];
|
||||
|
|
@ -1424,6 +1425,12 @@ static inline void audio_dequeuebuffer(FAR struct audio_upperhalf_s *upper,
|
|||
|
||||
audinfo("Entry\n");
|
||||
|
||||
if (upper->info.type == AUDIO_TYPE_OUTPUT)
|
||||
{
|
||||
apb->nbytes = 0;
|
||||
memset(apb->samp, 0, apb->nmaxbytes);
|
||||
}
|
||||
|
||||
flags = spin_lock_irqsave_nopreempt(&upper->spinlock);
|
||||
upper->status->tail++;
|
||||
audio_try_enqueue(upper);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue