aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavemds <dave@gurumeditation.it>2014-02-22 16:25:45 +0100
committerdavemds <dave@gurumeditation.it>2014-02-22 16:25:45 +0100
commit0b02540e4e49863f10277b3429d2d92eddda3474 (patch)
tree97cf827bd99c04afcbb135d8c2b67a7ed309ff87
parentEmotion test: added --loop and --position args. (diff)
downloadefl-0b02540e4e49863f10277b3429d2d92eddda3474.tar.gz
Emotion test: fix calculation of the displayed time.
-rw-r--r--src/tests/emotion/emotion_test_main.c8
1 files 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);