* @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 */
| 137 | * @return error code, RT_EOK is successful otherwise means failure |
| 138 | */ |
| 139 | static 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 |
no test coverage detected