[longomatch] Prevent firing a wrong seek when the current time can be retrieved
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Prevent firing a wrong seek when the current time can be retrieved
- Date: Tue, 6 Apr 2010 00:28:01 +0000 (UTC)
commit 416bce24de536d5c1ca2dd9664986228ecc3adb9
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Mon Apr 5 20:25:43 2010 +0200
Prevent firing a wrong seek when the current time can be retrieved
libcesarplayer/src/bacon-video-widget-gst-0.10.c | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/libcesarplayer/src/bacon-video-widget-gst-0.10.c b/libcesarplayer/src/bacon-video-widget-gst-0.10.c
index fbe2fa5..8d7b5d9 100644
--- a/libcesarplayer/src/bacon-video-widget-gst-0.10.c
+++ b/libcesarplayer/src/bacon-video-widget-gst-0.10.c
@@ -3508,19 +3508,21 @@ gboolean
bacon_video_widget_set_rate_in_segment (BaconVideoWidget * bvw, gfloat rate,
gint64 stop)
{
+ guint64 pos;
g_return_val_if_fail (bvw != NULL, FALSE);
g_return_val_if_fail (BACON_IS_VIDEO_WIDGET (bvw), FALSE);
g_return_val_if_fail (GST_IS_ELEMENT (bvw->priv->play), FALSE);
-
- //GST_LOG ("Seeking to %" GST_TIME_FORMAT, GST_TIME_ARGS (time * GST_MSECOND));
+
+ pos = bacon_video_widget_get_accurate_current_time (bvw);
+ if (pos == 0)
+ return FALSE;
gst_element_seek (bvw->priv->play, rate,
GST_FORMAT_TIME,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE |
GST_SEEK_FLAG_SEGMENT, GST_SEEK_TYPE_SET,
- bacon_video_widget_get_accurate_current_time (bvw) *
- GST_MSECOND, GST_SEEK_TYPE_SET, stop * GST_MSECOND);
+ pos * GST_MSECOND, GST_SEEK_TYPE_SET, stop * GST_MSECOND);
return TRUE;
}
@@ -3528,20 +3530,21 @@ bacon_video_widget_set_rate_in_segment (BaconVideoWidget * bvw, gfloat rate,
gboolean
bacon_video_widget_set_rate (BaconVideoWidget * bvw, gfloat rate)
{
-
+ guint64 pos;
+
g_return_val_if_fail (bvw != NULL, FALSE);
g_return_val_if_fail (BACON_IS_VIDEO_WIDGET (bvw), FALSE);
g_return_val_if_fail (GST_IS_ELEMENT (bvw->priv->play), FALSE);
- //GST_LOG ("Seeking to %" GST_TIME_FORMAT, GST_TIME_ARGS (time * GST_MSECOND));
-
+ pos = bacon_video_widget_get_accurate_current_time (bvw);
+ if (pos == 0)
+ return FALSE;
gst_element_seek (bvw->priv->play, rate,
GST_FORMAT_TIME,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE,
GST_SEEK_TYPE_SET,
- bacon_video_widget_get_accurate_current_time (bvw) *
- GST_MSECOND, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);
+ pos * GST_MSECOND, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]