[empathy] Reset clock after changing video resolution



commit 6fd0f2618c54d9300cd633c954b69f1d3d6e4197
Author: Nicolas Dufresne <nicolas dufresne collabora com>
Date:   Mon Jul 11 17:01:45 2011 -0400

    Reset clock after changing video resolution
    
    This workaround issue with videotestsrc when the test src does not have a
    a clock after going to NULL state while changing resolution.

 src/empathy-video-src.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/empathy-video-src.c b/src/empathy-video-src.c
index bfff30d..1e36254 100644
--- a/src/empathy-video-src.c
+++ b/src/empathy-video-src.c
@@ -426,6 +426,7 @@ empathy_video_src_set_resolution (GstElement *src,
 {
   EmpathyGstVideoSrcPrivate *priv = EMPATHY_GST_VIDEO_SRC_GET_PRIVATE (src);
   GstCaps *caps;
+  GstClock *gst_clock;
 
   g_return_if_fail (priv->capsfilter != NULL);
 
@@ -442,6 +443,13 @@ empathy_video_src_set_resolution (GstElement *src,
 
   g_object_set (priv->capsfilter, "caps", caps, NULL);
 
+  /* Reset clock an base time, this is require for videotestsrc and hopefully
+   * has no side effect */
+  gst_clock = gst_element_get_clock (src);
+  gst_element_set_clock (priv->src, gst_clock);
+  gst_element_set_base_time (priv->src, gst_element_get_base_time (src));
+  gst_object_unref (gst_clock);
+
   gst_element_set_locked_state (priv->src, FALSE);
   gst_element_sync_state_with_parent (priv->src);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]