close the android audio device
| 561 | |
| 562 | // close the android audio device |
| 563 | void cOpenslesSource::android_CloseAudioDevice(opensl_stream2 *p) { |
| 564 | if (p == NULL) |
| 565 | return; |
| 566 | openSLDestroyEngine(p); // destroys player, recorder, mix, and engine |
| 567 | smileCondDestroy(p->recorderCondition_); |
| 568 | smileCondDestroy(p->playerCondition_); |
| 569 | smileMutexDestroy(p->newDataMutex_); |
| 570 | for (int i = 0; i < NUM_RECORDING_BUFFERS; ++i) { |
| 571 | if (p->deviceInputBuffers[i] != NULL) { |
| 572 | free(p->deviceInputBuffers[i]); |
| 573 | p->deviceInputBuffers[i] = NULL; |
| 574 | } |
| 575 | } |
| 576 | for (int i = 0; i < NUM_RECORDING_DBL_BUFFERS; ++i) { |
| 577 | if (p->internalInputBuffers[i] != NULL) { |
| 578 | free(p->internalInputBuffers[i]); |
| 579 | p->internalInputBuffers[i] = NULL; |
| 580 | } |
| 581 | } |
| 582 | for (int i = 0; i < NUM_PLAYBACK_BUFFERS; ++i) { |
| 583 | if (p->deviceOutputBuffers[i] != NULL) { |
| 584 | free(p->deviceOutputBuffers[i]); |
| 585 | p->deviceOutputBuffers[i] = NULL; |
| 586 | } |
| 587 | } |
| 588 | free(p); |
| 589 | } |
| 590 | |
| 591 | // returns timestamp of the processed stream |
| 592 | double cOpenslesSource::android_GetTimestamp(opensl_stream2 *p){ |
nothing calls this directly
no test coverage detected