From 0b02540e4e49863f10277b3429d2d92eddda3474 Mon Sep 17 00:00:00 2001 From: davemds Date: Sat, 22 Feb 2014 16:25:45 +0100 Subject: [PATCH] Emotion test: fix calculation of the displayed time. --- src/tests/emotion/emotion_test_main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tests/emotion/emotion_test_main.c b/src/tests/emotion/emotion_test_main.c index 434d01241b..4b5edff24b 100644 --- a/src/tests/emotion/emotion_test_main.c +++ b/src/tests/emotion/emotion_test_main.c @@ -309,13 +309,17 @@ video_obj_time_changed(Evas_Object *obj, Evas_Object *edje) len = emotion_object_play_length_get(obj); scale = (len > 0.0) ? pos / len : 0.0; edje_object_part_drag_value_set(edje, "video_progress", scale, 0.0); + lh = len / 3600; lm = len / 60 - (lh * 60); - ls = len - (lm * 60); + ls = len - (lh * 3600) - (lm * 60); + ph = pos / 3600; pm = pos / 60 - (ph * 60); - ps = pos - (pm * 60); + ps = pos - (ph * 3600) - (pm * 60); + pf = pos * 100 - (ps * 100) - (pm * 60 * 100) - (ph * 60 * 60 * 100); + snprintf(buf, sizeof(buf), "%i:%02i:%02i.%02i / %i:%02i:%02i", ph, pm, ps, pf, lh, lm, ls); edje_object_part_text_set(edje, "video_progress_txt", buf);