From: <th...@ke...> - 2009-10-22 12:03:47
|
Module: gstreamer Branch: master Commit: dc2c4de73a5e0750bda43c9fdf1ba089669feae2 URL: http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=dc2c4de73a5e0750bda43c9fdf1ba089669feae2 Author: Jan Schmidt <th...@no...> Date: Thu Oct 22 12:52:46 2009 +0100 gstpipeline: Simplify base time checking slightly Simplify checking and distribution of the base time - don't re-check the value of a local variable that was set 3 lines earlier. --- gst/gstpipeline.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/gst/gstpipeline.c b/gst/gstpipeline.c index af9b17c..2095b31 100644 --- a/gst/gstpipeline.c +++ b/gst/gstpipeline.c @@ -346,7 +346,6 @@ gst_pipeline_change_state (GstElement * element, GstStateChange transition) break; case GST_STATE_CHANGE_PAUSED_TO_PLAYING: { - GstClockTime new_base_time; GstClockTime now, start_time, last_start_time, delay; gboolean update_clock; GstClock *cur_clock; @@ -407,20 +406,18 @@ gst_pipeline_change_state (GstElement * element, GstStateChange transition) gst_object_unref (clock); if (start_time != GST_CLOCK_TIME_NONE && now != GST_CLOCK_TIME_NONE) { - new_base_time = now - start_time + delay; + GstClockTime new_base_time = now - start_time + delay; GST_DEBUG_OBJECT (element, "start_time=%" GST_TIME_FORMAT ", now=%" GST_TIME_FORMAT ", base_time %" GST_TIME_FORMAT, GST_TIME_ARGS (start_time), GST_TIME_ARGS (now), GST_TIME_ARGS (new_base_time)); - } else - new_base_time = GST_CLOCK_TIME_NONE; - if (new_base_time != GST_CLOCK_TIME_NONE) gst_element_set_base_time (element, new_base_time); - else + } else { GST_DEBUG_OBJECT (pipeline, "NOT adjusting base_time because start_time is NONE"); + } } else { GST_DEBUG_OBJECT (pipeline, "NOT adjusting base_time because we selected one before"); |