Fix bug detected from static analysis tool 87/258587/1 submit/tizen/20210521.041745
authorwn.jang <wn.jang@samsung.com>
Fri, 21 May 2021 01:51:56 +0000 (10:51 +0900)
committerwn.jang <wn.jang@samsung.com>
Fri, 21 May 2021 01:51:56 +0000 (10:51 +0900)
Change-Id: I340a8f7a74cafb64ecb741a3a7c46ed56849d5f2

server/vcd_recorder.c

index 956bdbe7efd4b52f5a76bb34d9ef6233d39cfbdc..f532aca9cd58c7501e34b975a1dd35aca08ec7b0 100644 (file)
@@ -542,6 +542,7 @@ int vcd_recorder_create(vcd_recoder_audio_cb audio_cb, vcd_recorder_interrupt_cb
 int vcd_recorder_destroy()
 {
        ma_ap_deinitialize();
+       int ret = -1;
        if (VCD_RECORDER_STATE_RECORDING == g_recorder_state) {
                if (0 == strncmp(VCE_AUDIO_ID_BLUETOOTH, g_current_audio_type, strlen(VCE_AUDIO_ID_BLUETOOTH))) {
 #ifdef TV_BT_MODE
@@ -552,12 +553,15 @@ int vcd_recorder_destroy()
                        UnRegisterMSFAudioCallback();
 #endif
                } else {
-                       audio_in_unprepare(g_audio_h);
+                       ret = audio_in_unprepare(g_audio_h);
+                       if (AUDIO_IO_ERROR_NONE != ret) {
+                               SLOG(LOG_ERROR, TAG_VCD, "[Recorder ERROR] Fail to unprepare audio : %d", ret);
+                       }
                }
                g_recorder_state = VCD_RECORDER_STATE_READY;
        }
 
-       int ret = sound_manager_remove_device_connection_changed_cb(g_device_id);
+       ret = sound_manager_remove_device_connection_changed_cb(g_device_id);
        if (0 != ret)
                SLOG(LOG_ERROR, TAG_VCD, "[Recorder ERROR] Fail to remove device connection changed callback, ret(%d)", ret);
        g_device_id = -1;