summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2010-12-05 14:55:19 +0000
committerDamien Lespiau <damien.lespiau@intel.com>2010-12-05 14:55:19 +0000
commite9c7ccaf7c16c46f1ed85bd338eeebbd67c39697 (patch)
tree00e88cb59c72521bb2dc5f1a552ba877cc4eefc3
parentd80c32aa80993b040538883c746f4ebab9932280 (diff)
video-texture: Don't return in progress of 0.0 when seeking
When seeking, the progress returned by playbin2 is 0.0. We want that to be the last known position instead as returning 0.0 will have some ugly effects, say on a progress bar getting updated from the progress tick.
-rw-r--r--clutter-gst/clutter-gst-video-texture.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clutter-gst/clutter-gst-video-texture.c b/clutter-gst/clutter-gst-video-texture.c
index 5778099..617d46f 100644
--- a/clutter-gst/clutter-gst-video-texture.c
+++ b/clutter-gst/clutter-gst-video-texture.c
@@ -61,6 +61,7 @@ struct _ClutterGstVideoTexturePrivate
guint in_seek : 1;
guint is_idle : 1;
gdouble stacked_progress;
+ gdouble last_known_progress;
GstState stacked_state;
guint tick_timeout_id;
@@ -513,6 +514,12 @@ get_progress (ClutterGstVideoTexture *video_texture)
if (!priv->pipeline)
return 0.0;
+ /* When seeking, the progress returned by playbin2 is 0.0. We want that to be
+ * the last known position instead as returning 0.0 will have some ugly
+ * effects, say on a progress bar getting updated from the progress tick. */
+ if (priv->in_seek)
+ return priv->last_known_progress;
+
position_q = gst_query_new_position (GST_FORMAT_TIME);
duration_q = gst_query_new_duration (GST_FORMAT_TIME);
@@ -536,6 +543,8 @@ get_progress (ClutterGstVideoTexture *video_texture)
CLUTTER_GST_NOTE (MEDIA, "get progress: %.02f", progress);
+ priv->last_known_progress = progress;
+
return progress;
}