gint64 len;
gint len_seconds = 0;
- //if (!desktop_plugin || !desktop_plugin->priv->pipeline)
- // return FALSE;
+ if (!desktop_plugin || !desktop_plugin->priv->pipeline)
+ return FALSE;
if (desktop_plugin->priv->theme_int_parametr1 == 0){
if (!gst_element_seek(GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
return FALSE;
}
- gst_element_query_position(desktop_plugin->priv->pipeline, &fmt, &len);
- len_seconds = len / GST_SECOND;
- fprintf(stderr, "timeout %i %i\n", len_seconds, desktop_plugin->priv->theme_int_parametr1);
- if (len <0)
+ if (gst_element_get_state (desktop_plugin->priv->pipeline, NULL, NULL, -1) == GST_STATE_CHANGE_FAILURE)
return TRUE;
- if (len_seconds < desktop_plugin->priv->theme_int_parametr1){
- if (!gst_element_seek(GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
+ else{
+ if (!gst_element_seek(GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
fprintf(stderr,"Error in seek:\n");
- return TRUE;
- }else
- return FALSE;
+ return FALSE;
+ }
}
/*******************************************************************************/
void