summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/media.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/bin/media.c b/src/bin/media.c
index 8df7ee3..1e48705 100644
--- a/src/bin/media.c
+++ b/src/bin/media.c
@@ -31,7 +31,7 @@ struct _Media
31 int w, h; 31 int w, h;
32 int iw, ih; 32 int iw, ih;
33 int sw, sh; 33 int sw, sh;
34 int fr, frnum; 34 int fr, frnum, loops;
35 int mode, type; 35 int mode, type;
36 int resizes; 36 int resizes;
37 struct { 37 struct {
@@ -269,6 +269,27 @@ _cb_img_frame(void *data)
269 if (!sd) return EINA_FALSE; 269 if (!sd) return EINA_FALSE;
270 sd->fr++; 270 sd->fr++;
271 fr = ((sd->fr - 1) % (sd->frnum)) + 1; 271 fr = ((sd->fr - 1) % (sd->frnum)) + 1;
272 if ((sd->fr >= sd->frnum) && (fr == 1))
273 {
274 int loops;
275
276 if (evas_object_image_animated_loop_type_get(sd->o_img) ==
277 EVAS_IMAGE_ANIMATED_HINT_NONE)
278 {
279 sd->anim = NULL;
280 return EINA_FALSE;
281 }
282 sd->loops++;
283 loops = evas_object_image_animated_loop_count_get(sd->o_img);
284 if (loops != 0) // loop == 0 -> loop forever
285 {
286 if (loops < sd->loops)
287 {
288 sd->anim = NULL;
289 return EINA_FALSE;
290 }
291 }
292 }
272 evas_object_image_animated_frame_set(sd->o_img, fr); 293 evas_object_image_animated_frame_set(sd->o_img, fr);
273 t = evas_object_image_animated_frame_duration_get(sd->o_img, fr, 0); 294 t = evas_object_image_animated_frame_duration_get(sd->o_img, fr, 0);
274 ecore_timer_interval_set(sd->anim, t); 295 ecore_timer_interval_set(sd->anim, t);