| 171 | } |
| 172 | |
| 173 | static void BufferQueueCallback(SLBufferQueueItf queueItf, void *context) |
| 174 | { |
| 175 | OpenSLDevice* opensl = (OpenSLDevice*) context; |
| 176 | DM_MUTEX_SCOPED_LOCK(opensl->m_Mutex); |
| 177 | |
| 178 | if (opensl->m_Playing.Size() > 0) { |
| 179 | Buffer b = opensl->m_Playing.Pop(); |
| 180 | opensl->m_Free.Push(b); |
| 181 | } |
| 182 | if (opensl->m_Ready.Size() > 0) { |
| 183 | Buffer b = opensl->m_Ready.Pop(); |
| 184 | SLresult res = (*queueItf)->Enqueue(queueItf, b.m_Buffer, b.m_FrameCount * sizeof(uint16_t) * 2); |
| 185 | CheckAndPrintError(res); |
| 186 | opensl->m_Playing.Push(b); |
| 187 | } else { |
| 188 | opensl->m_Underflow = true; |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | static int GetSampleRate() |
| 193 | { |
no test coverage detected