change ecore timer to async function 37/138037/3
authorWonnam Jang <wn.jang@samsung.com>
Tue, 11 Jul 2017 01:50:43 +0000 (10:50 +0900)
committerWonnam Jang <wn.jang@samsung.com>
Mon, 17 Jul 2017 23:26:36 +0000 (08:26 +0900)
Change-Id: Ie57bbd6c5ae9cdf28592ee5c5e11064ff6f2c1ac
Signed-off-by: Wonnam Jang <wn.jang@samsung.com>
server/vcd_recorder.c

index e2ac9c2..af4bb75 100644 (file)
@@ -468,6 +468,9 @@ int vcd_recorder_set(const char* audio_type, vcp_audio_type_e type, int rate, in
                        SLOG(LOG_DEBUG, TAG_VCD, "[Recorder] Current audio type is already set : %s", audio_type);
                        return 0;
                }
+       } else {
+               SLOG(LOG_ERROR, TAG_VCD, "[Recorder ERROR] Recorder is NOT created");
+               return VCD_ERROR_INVALID_STATE;
        }
 
        SLOG(LOG_DEBUG, TAG_VCD, "[Recorder] set audio type (%s)", audio_type);
@@ -672,6 +675,13 @@ Eina_Bool __read_normal_func(void *data)
        return EINA_TRUE;
 }
 
+static void __timer_read_normal_func(void *data) 
+{
+       SLOG(LOG_DEBUG, TAG_VCD, "[Recorder] before __read_normal_func");
+       ecore_timer_add(0, __read_normal_func, NULL);
+       return;
+}
+
 static void __check_audio_format()
 {
        vcp_audio_type_e type;
@@ -817,7 +827,7 @@ int vcd_recorder_start()
                }
 
                /* Add ecore timer to read audio data */
-               ecore_timer_add(0, __read_normal_func, NULL);
+               ecore_main_loop_thread_safe_call_async(__timer_read_normal_func, NULL);
                SLOG(LOG_DEBUG, TAG_VCD, "[Recorder] Start audio in recorder");
        }