summaryrefslogtreecommitdiff
path: root/src/modules/ethumb
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-03-25 16:12:54 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-03-25 18:46:51 +0900
commit5bb45cecbff14166f3f1c96392b1e0bb59859504 (patch)
tree794c922dd64b43df912d14670f11c81e68045a3c /src/modules/ethumb
parent6e8fe3b03d179f65ca87e0cf744907903e150c5b (diff)
imrpovement in ethumb video generation - wait a few frames so we have
something rendered at new pos... :)
Diffstat (limited to 'src/modules/ethumb')
-rw-r--r--src/modules/ethumb/emotion/emotion.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/modules/ethumb/emotion/emotion.c b/src/modules/ethumb/emotion/emotion.c
index 651dc15f85..cf5e9b856e 100644
--- a/src/modules/ethumb/emotion/emotion.c
+++ b/src/modules/ethumb/emotion/emotion.c
@@ -33,6 +33,7 @@ struct _emotion_plugin
33 double total_time, tmp_time; 33 double total_time, tmp_time;
34 unsigned int pcount; 34 unsigned int pcount;
35 unsigned int frnum; 35 unsigned int frnum;
36 unsigned int okfr;
36 Eina_Bool first; 37 Eina_Bool first;
37 Eet_File *ef; 38 Eet_File *ef;
38 Evas_Object *video; 39 Evas_Object *video;
@@ -88,6 +89,7 @@ _video_stopped_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_
88{ 89{
89 struct _emotion_plugin *_plugin = data; 90 struct _emotion_plugin *_plugin = data;
90 91
92 _plugin->okfr = 0;
91 _plugin->pi = 0; 93 _plugin->pi = 0;
92 _plugin->ptotal = 0; 94 _plugin->ptotal = 0;
93 _plugin->first = EINA_FALSE; 95 _plugin->first = EINA_FALSE;
@@ -107,12 +109,12 @@ _video_pos_set(struct _emotion_plugin *_plugin)
107 if (_plugin->len > 0) 109 if (_plugin->len > 0)
108 _plugin->first = EINA_TRUE; 110 _plugin->first = EINA_TRUE;
109 111
110 if (pos <=0 || pos >= 1) 112 if ((pos <= 0) || (pos >= 1))
111 _plugin->pi = 0.1 * _plugin->len + _plugin->pcount * 113 _plugin->pi = (0.1 * _plugin->len) +
112 _plugin->len * interval; 114 (_plugin->pcount * _plugin->len * interval);
113 else 115 else
114 _plugin->pi = pos * _plugin->len + _plugin->pcount * 116 _plugin->pi = (pos * _plugin->len) +
115 _plugin->len * interval; 117 (_plugin->pcount * _plugin->len * interval);
116 118
117 emotion_object_position_set(_plugin->video, _plugin->pi); 119 emotion_object_position_set(_plugin->video, _plugin->pi);
118} 120}
@@ -233,8 +235,8 @@ _frame_grab_single(void *data)
233 } 235 }
234 236
235 p = emotion_object_position_get(_plugin->video); 237 p = emotion_object_position_get(_plugin->video);
236// if (p < _plugin->pi) 238 _plugin->okfr++;
237 if (p <= 0.0) 239 if (_plugin->okfr < 5)
238 return EINA_TRUE; 240 return EINA_TRUE;
239 241
240 DBG("saving static thumbnail at position=%f (intended=%f)", p, _plugin->pi); 242 DBG("saving static thumbnail at position=%f (intended=%f)", p, _plugin->pi);