g_volume_stream = NULL;
}
- ret = audio_in_unprepare(g_audio_in);
- if (AUDIO_IO_ERROR_NONE != ret) {
- LOGD("[Recorder ERROR] Fail to stop audio : %d", ret);
+ if (g_audio_in) {
+ ret = audio_in_unprepare(g_audio_in);
+ if (AUDIO_IO_ERROR_NONE != ret) {
+ LOGD("[Recorder ERROR] Fail to stop audio : %d", ret);
+ }
}
- if (0 != sound_manager_destroy_stream_information(g_stream_info)) {
- LOGD("[Recorder ERROR] Fail to destroy stream info");
+ if (g_stream_info) {
+ if (0 != sound_manager_destroy_stream_information(g_stream_info)) {
+ LOGD("[Recorder ERROR] Fail to destroy stream info");
+ }
+ g_stream_info = NULL;
}
- g_stream_info = NULL;
- ret = audio_in_destroy(g_audio_in);
- if (AUDIO_IO_ERROR_NONE != ret) {
- LOGD("[Recorder ERROR] Fail to destroy audio : %d", ret);
+ if (g_audio_in) {
+ ret = audio_in_destroy(g_audio_in);
+ if (AUDIO_IO_ERROR_NONE != ret) {
+ LOGD("[Recorder ERROR] Fail to destroy audio : %d", ret);
+ }
+ g_audio_in = NULL;
}
- g_audio_in = NULL;
}
static void recorder_thread_func()