summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/emotion/gstreamer/emotion_gstreamer.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/modules/emotion/gstreamer/emotion_gstreamer.c b/src/modules/emotion/gstreamer/emotion_gstreamer.c
index caa844e..9719515 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,
379 gst_element_set_state(ev->pipeline, GST_STATE_PLAYING); 379 gst_element_set_state(ev->pipeline, GST_STATE_PLAYING);
380} 380}
381 381
382/**
383 * Returns stream duration in seconds
384 */
382static double 385static double
383em_len_get(void *video) 386em_len_get(void *video)
384{ 387{
@@ -401,7 +404,7 @@ em_len_get(void *video)
401 404
402 if (fmt != GST_FORMAT_TIME) 405 if (fmt != GST_FORMAT_TIME)
403 { 406 {
404 DBG("requrested duration in time, but got %s instead.", 407 DBG("requested duration in time, but got %s instead.",
405 gst_format_get_name(fmt)); 408 gst_format_get_name(fmt));
406 goto fallback; 409 goto fallback;
407 } 410 }
@@ -409,7 +412,7 @@ em_len_get(void *video)
409 if (val <= 0.0) 412 if (val <= 0.0)
410 goto fallback; 413 goto fallback;
411 414
412 return val / 1000000000.0; 415 return GST_TIME_AS_SECONDS(val);
413 416
414 fallback: 417 fallback:
415 if (!_emotion_gstreamer_video_pipeline_parse(ev, EINA_FALSE)) 418 if (!_emotion_gstreamer_video_pipeline_parse(ev, EINA_FALSE))
@@ -503,6 +506,9 @@ em_fps_get(void *video)
503 return 0.0; 506 return 0.0;
504} 507}
505 508
509/**
510 * Returns stream position in seconds
511 */
506static double 512static double
507em_pos_get(void *video) 513em_pos_get(void *video)
508{ 514{
@@ -522,12 +528,12 @@ em_pos_get(void *video)
522 528
523 if (fmt != GST_FORMAT_TIME) 529 if (fmt != GST_FORMAT_TIME)
524 { 530 {
525 ERR("requrested position in time, but got %s instead.", 531 ERR("requested position in time, but got %s instead.",
526 gst_format_get_name(fmt)); 532 gst_format_get_name(fmt));
527 return ev->position; 533 return ev->position;
528 } 534 }
529 535
530 ev->position = val / 1000000000.0; 536 ev->position = GST_TIME_AS_SECONDS(val);
531 return ev->position; 537 return ev->position;
532} 538}
533 539