| 905 | } |
| 906 | |
| 907 | SLresult openSLstopRecording(opensl_stream2 *p) { |
| 908 | SLresult result; |
| 909 | if (p->recorderRecord != NULL) { |
| 910 | // in case already recording, stop recording and clear buffer queue |
| 911 | result = (*p->recorderRecord)->SetRecordState(p->recorderRecord, SL_RECORDSTATE_STOPPED); |
| 912 | if (result != SL_RESULT_SUCCESS) { |
| 913 | SMILE_ERR(3, "openSL: failed to set recorder state to stopped."); |
| 914 | return result; |
| 915 | } |
| 916 | // (void)result; |
| 917 | result = (*p->recorderBufferQueue)->Clear(p->recorderBufferQueue); |
| 918 | if (result != SL_RESULT_SUCCESS) { |
| 919 | SMILE_ERR(3, "openSL: failed to clear recorder buffer queue."); |
| 920 | return result; |
| 921 | } |
| 922 | SMILE_MSG(3, "openSL: recording: set state = stopped, success"); |
| 923 | } else { |
| 924 | SMILE_ERR(1, "openSL: no recorder present, cannot stop recording"); |
| 925 | return -1; |
| 926 | } |
| 927 | return SL_RESULT_SUCCESS; |
| 928 | } |
| 929 | |
| 930 | SLresult openSLstartRecording(opensl_stream2 *p) { |
| 931 | SLresult result; |
no test coverage detected