Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/gstreamer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-06-13 19:33:27 +0300
committerSebastian Dröge <sebastian@centricular.com>2016-06-27 09:26:23 +0300
commitba536c23078b8508d43fb1432521d5ec077c5336 (patch)
treee74a2648696244a843edc1d6e7f12e5a5423fa66
parent3de8a4f728a7194a12b784ec4085f6a8e7d9b5bd (diff)
basesink: Update start time when losing state only if we were in PLAYING
If we were in PAUSED, the current clock time and base time don't have much to do with the running time anymore as the clock might have advanced while we were PAUSED. The system clock does that for example, audio clocks often don't. Updating the start time in PAUSED will cause a) the wrong position to be reported, b) step events to step not just the requested amount but the amount of time we spent in PAUSED. The start time should only ever be updated when going from PLAYING to PAUSED to remember the current running time (to be able to compensate later when going to PLAYING for the clock time advancing while PAUSED), not when we are already in PAUSED. Based on a patch by Kishore Arepalli <kishore.arepalli@gmail.com> The updating of the start time when the state is lost was added in commit ba943a82c0bbfd17c9ee9f5068d44c9d9274fd13 to fix the position reporting when the state is lost. This still works correctly after this change. https://bugzilla.gnome.org/show_bug.cgi?id=739289
-rw-r--r--libs/gst/base/gstbasesink.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c
index 035895101e..f0d8c40c6a 100644
--- a/libs/gst/base/gstbasesink.c
+++ b/libs/gst/base/gstbasesink.c
@@ -2925,7 +2925,8 @@ gst_base_sink_update_start_time (GstBaseSink * basesink)
GstClock *clock;
GST_OBJECT_LOCK (basesink);
- if ((clock = GST_ELEMENT_CLOCK (basesink))) {
+ if (GST_STATE (basesink) == GST_STATE_PLAYING
+ && (clock = GST_ELEMENT_CLOCK (basesink))) {
GstClockTime now;
gst_object_ref (clock);