diff options
author | Jan Schmidt <thaytan@noraisin.net> | 2009-10-22 12:52:46 +0100 |
---|---|---|
committer | Jan Schmidt <thaytan@noraisin.net> | 2009-10-22 12:54:17 +0100 |
commit | dc2c4de73a5e0750bda43c9fdf1ba089669feae2 (patch) | |
tree | 31bd5bc787e401e8702d41f02bbc2534f8977a6c | |
parent | 517ab2860e90b2c6d255096dd02409434f4bb62b (diff) |
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.
-rw-r--r-- | gst/gstpipeline.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/gst/gstpipeline.c b/gst/gstpipeline.c index af9b17c71..2095b31fe 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"); |