[0.3.81] modify the test suite about subtitle 51/168351/1
authorEunhae Choi <eunhae1.choi@samsung.com>
Fri, 26 Jan 2018 04:23:32 +0000 (13:23 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Fri, 26 Jan 2018 04:23:32 +0000 (13:23 +0900)
Change-Id: I0c1193827082182bdf9055dcf9262fb12f49d0da

src/player.c
test/player_test.c

index 3d0d54a33cbf08843ba4b225c6d36054e65e73e9..96a32a266ce6c78c368e176cc6efe880cb4e4974 100644 (file)
@@ -532,10 +532,13 @@ static void __capture_cb_handler(callback_cb_info_s * cb_info, _player_recv_data
                data = g_new(unsigned char, size);
                if (data) {
                        memcpy(data, thandle.ptr, size);
+
+                       LOGD("captured image %d x %d, %d", width, height, size);
                        ((player_video_captured_cb) cb_info->user_cb[MUSE_PLAYER_EVENT_TYPE_CAPTURE]) (data, width, height, size, cb_info->user_data[MUSE_PLAYER_EVENT_TYPE_CAPTURE]);
                        g_free(data);
-               } else
+               } else {
                        LOGE("g_new failure");
+               }
 
                tbm_bo_unmap(bo);
        }
index 10e9aae3d0275e4f4389ea51b1e99a6dda732d38..8fc737239956bb594c7b75c6c4ce0f4605af5100 100644 (file)
@@ -1019,13 +1019,7 @@ static void feed_video_data_thread_func(void *data)
 static void _player_prepare(bool async)
 {
        int ret = FALSE;
-       int slen = strlen(g_subtitle_uri);
 
-       if (slen > 0 && slen < MAX_STRING_LEN) {
-               g_print("0. set subtile path() (size : %d) - %s  \n", slen, g_subtitle_uri);
-               player_set_subtitle_path(g_player[0], g_subtitle_uri);
-               player_set_subtitle_updated_cb(g_player[0], subtitle_updated_cb, (void *)g_player[0]);
-       }
        if (g_current_surface_type == -1) {
                g_print("You must set display surface type before setting prepare.\n");
                return;
@@ -1158,7 +1152,6 @@ static void _player_unprepare()
                }
        }
 
-       memset(g_subtitle_uri, 0, sizeof(g_subtitle_uri));
        player_state_e state;
        if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) {
                ret = player_get_state(g_player[0], &state);
@@ -1810,12 +1803,18 @@ static void input_subtitle_filename(char *subtitle_filename)
 {
        int len = strlen(subtitle_filename);
 
-       if (len < 1 || len > MAX_STRING_LEN)
-               return;
+       if (len < 1 || len > MAX_STRING_LEN) {
+               g_print("subtitle uri will be clear (only in idle state)");
+               player_set_subtitle_path(g_player[0], NULL);
+               player_set_subtitle_updated_cb(g_player[0], subtitle_updated_cb, (void *)g_player[0]);
+       } else {
+               strncpy(g_subtitle_uri, subtitle_filename, len);
+               g_print("subtitle uri is set to %s\n", g_subtitle_uri);
+               player_set_subtitle_path(g_player[0], g_subtitle_uri);
+               player_set_subtitle_updated_cb(g_player[0], subtitle_updated_cb, (void *)g_player[0]);
+       }
 
-       strncpy(g_subtitle_uri, subtitle_filename, len);
-       g_print("subtitle uri is set to %s\n", g_subtitle_uri);
-       player_set_subtitle_path(g_player[0], g_subtitle_uri);
+       memset(g_subtitle_uri, 0, sizeof(g_subtitle_uri));
 }
 
 static void switch_subtitle(int index)