cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2cf1fd3be9c4da357d962e0525bbbc8eda8008ba
commit 2cf1fd3be9c4da357d962e0525bbbc8eda8008ba Author: Reynaldo H. Verdejo Pinochet <reyna...@osg.samsung.com> Date: Tue Aug 29 17:08:03 2017 -0700 emotion: gst: use proper GStreamer time-unit macros Summary: Do not harcode numbers that make no immediate sense. Additionally: add some wont-hurt doc note and fix two related typos. Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D5145 Signed-off-by: Cedric BAIL <ced...@osg.samsung.com> --- src/modules/emotion/gstreamer/emotion_gstreamer.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/modules/emotion/gstreamer/emotion_gstreamer.c b/src/modules/emotion/gstreamer/emotion_gstreamer.c index caa844e856..97195151db 100644 --- a/src/modules/emotion/gstreamer/emotion_gstreamer.c +++ b/src/modules/emotion/gstreamer/emotion_gstreamer.c @@ -379,6 +379,9 @@ em_pos_set(void *video, gst_element_set_state(ev->pipeline, GST_STATE_PLAYING); } +/** + * Returns stream duration in seconds + */ static double em_len_get(void *video) { @@ -401,7 +404,7 @@ em_len_get(void *video) if (fmt != GST_FORMAT_TIME) { - DBG("requrested duration in time, but got %s instead.", + DBG("requested duration in time, but got %s instead.", gst_format_get_name(fmt)); goto fallback; } @@ -409,7 +412,7 @@ em_len_get(void *video) if (val <= 0.0) goto fallback; - return val / 1000000000.0; + return GST_TIME_AS_SECONDS(val); fallback: if (!_emotion_gstreamer_video_pipeline_parse(ev, EINA_FALSE)) @@ -503,6 +506,9 @@ em_fps_get(void *video) return 0.0; } +/** + * Returns stream position in seconds + */ static double em_pos_get(void *video) { @@ -522,12 +528,12 @@ em_pos_get(void *video) if (fmt != GST_FORMAT_TIME) { - ERR("requrested position in time, but got %s instead.", + ERR("requested position in time, but got %s instead.", gst_format_get_name(fmt)); return ev->position; } - ev->position = val / 1000000000.0; + ev->position = GST_TIME_AS_SECONDS(val); return ev->position; } --