emotion gstreamer1: Implement seekability check via seeking query

This commit is contained in:
Sebastian Dröge 2014-01-12 20:36:14 +01:00
parent 463ef7b964
commit 1c6cb51cdc
1 changed files with 22 additions and 3 deletions

View File

@ -458,10 +458,29 @@ em_audio_handled(void *video)
}
static int
em_seekable(void *video EINA_UNUSED)
em_seekable(void *video)
{
/* FIXME: Implement with SEEKING query and duration */
return 1;
Emotion_Gstreamer *ev = video;
GstQuery *query;
int ret = 0;
gboolean seekable;
if (!ev->ready) return ret;
query = gst_query_new_seeking(GST_FORMAT_TIME);
if (!gst_element_query(ev->pipeline, query))
goto on_error;
gst_query_parse_seeking(query, NULL, &seekable, NULL, NULL);
if (!seekable)
goto on_error;
ret = 1;
on_error:
gst_query_unref(query);
return ret;
}
static void