MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _audio_flush_replay_frame

Function _audio_flush_replay_frame

components/drivers/audio/dev_audio.c:139–154  ·  view source on GitHub ↗

* @brief Write replay frame into audio device replay queue * * @param[in] audio pointer to audio device * * @return error code, RT_EOK is successful otherwise means failure */

Source from the content-addressed store, hash-verified

137 * @return error code, RT_EOK is successful otherwise means failure
138 */
139static rt_err_t _audio_flush_replay_frame(struct rt_audio_device *audio)
140{
141 rt_err_t result = RT_EOK;
142
143 if (audio->replay->write_index)
144 {
145 result = rt_data_queue_push(&audio->replay->queue,
146 (const void **)audio->replay->write_data,
147 audio->replay->write_index,
148 RT_WAITING_FOREVER);
149
150 audio->replay->write_index = 0;
151 }
152
153 return result;
154}
155
156/**
157 * @brief Replay audio

Callers 1

_aduio_replay_stopFunction · 0.85

Calls 1

rt_data_queue_pushFunction · 0.85

Tested by

no test coverage detected