diff --git a/docs/manual/advanced-clocks.xml b/docs/manual/advanced-clocks.xml
index 2ab1350bc3..dc2a756fbd 100644
--- a/docs/manual/advanced-clocks.xml
+++ b/docs/manual/advanced-clocks.xml
@@ -12,14 +12,16 @@
- &GStreamer; derives several times from the clock and the playback state.
+ &GStreamer; derives several time value from the clock
+ and the playback state.
It is important to note, that a clock-time is
monotonically rising, but the value itself is not meaningful.
Subtracting the base-time yields the
running-time. It is the same as the
stream-time if one plays from start to end at original
rate. The stream-time indicates the position in the
- media.
+ media. The running-time is (re-)set to 0 when the
+ pipeline starts to play and also after flushing seeks.
diff --git a/gst/gstevent.c b/gst/gstevent.c
index 821ea7b768..d5d0b8f3b4 100644
--- a/gst/gstevent.c
+++ b/gst/gstevent.c
@@ -409,7 +409,7 @@ gst_event_has_name (GstEvent * event, const gchar * name)
* required.
*
* Note that events and messages share the same sequence number incrementor;
- * two events or messages will never not have the same sequence number unless
+ * two events or messages will never have the same sequence number unless
* that correspondence was made explicitly.
*
* Returns: The event's sequence number.
diff --git a/gst/gstmessage.c b/gst/gstmessage.c
index 58f47b361c..634bfd1757 100644
--- a/gst/gstmessage.c
+++ b/gst/gstmessage.c
@@ -309,7 +309,7 @@ gst_message_new_custom (GstMessageType type, GstObject * src,
* it is not required.
*
* Note that events and messages share the same sequence number incrementor;
- * two events or messages will never not have the same sequence number unless
+ * two events or messages will never have the same sequence number unless
* that correspondence was made explicitly.
*
* Returns: The message's sequence number.
diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c
index da7e324981..11b9267479 100644
--- a/libs/gst/base/gstbaseparse.c
+++ b/libs/gst/base/gstbaseparse.c
@@ -1935,9 +1935,10 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
ret = GST_FLOW_OK;
} else if (ret == GST_FLOW_OK) {
if (parse->segment.rate > 0.0) {
+ GST_LOG_OBJECT (parse, "pushing frame (%" G_GSIZE_FORMAT " bytes) now..",
+ size);
ret = gst_pad_push (parse->srcpad, buffer);
- GST_LOG_OBJECT (parse, "frame (%" G_GSIZE_FORMAT " bytes) pushed: %s",
- size, gst_flow_get_name (ret));
+ GST_LOG_OBJECT (parse, "frame pushed, flow %s", gst_flow_get_name (ret));
} else {
GST_LOG_OBJECT (parse, "frame (%" G_GSIZE_FORMAT " bytes) queued for now",
size);
@@ -1946,9 +1947,9 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
ret = GST_FLOW_OK;
}
} else {
- gst_buffer_unref (buffer);
GST_LOG_OBJECT (parse, "frame (%" G_GSIZE_FORMAT " bytes) not pushed: %s",
size, gst_flow_get_name (ret));
+ gst_buffer_unref (buffer);
/* if we are not sufficiently in control, let upstream decide on EOS */
if (ret == GST_FLOW_UNEXPECTED &&
(parse->priv->passthrough ||
diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c
index d9cf0b0cf3..0d7e1737ca 100644
--- a/libs/gst/base/gstbasesink.c
+++ b/libs/gst/base/gstbasesink.c
@@ -227,6 +227,8 @@ struct _GstBaseSinkPrivate
/* if we already commited the state */
gboolean commited;
+ /* state change to playing ongoing */
+ gboolean to_playing;
/* when we received EOS */
gboolean received_eos;
@@ -4503,6 +4505,14 @@ gst_base_sink_get_position (GstBaseSink * basesink, GstFormat format,
else
gst_object_ref (clock);
+ /* mainloop might be querying position when going to playing async,
+ * while (audio) rendering might be quickly advancing stream position,
+ * so use clock asap rather than last reported position */
+ if (in_paused && with_clock && g_atomic_int_get (&basesink->priv->to_playing)) {
+ GST_DEBUG_OBJECT (basesink, "going to PLAYING, so not PAUSED");
+ in_paused = FALSE;
+ }
+
/* collect all data we need holding the lock */
if (GST_CLOCK_TIME_IS_VALID (segment->time))
time = segment->time;
@@ -4907,6 +4917,7 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition)
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
GST_BASE_SINK_PREROLL_LOCK (basesink);
+ g_atomic_int_set (&basesink->priv->to_playing, TRUE);
if (!gst_base_sink_needs_preroll (basesink)) {
GST_DEBUG_OBJECT (basesink, "PAUSED to PLAYING, don't need preroll");
/* no preroll needed anymore now. */
@@ -4952,7 +4963,14 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition)
}
switch (transition) {
+ case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
+ /* completed transition, so need not be marked any longer
+ * And it should be unmarked, since e.g. losing our position upon flush
+ * does not really change state to PAUSED ... */
+ g_atomic_int_set (&basesink->priv->to_playing, FALSE);
+ break;
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
+ g_atomic_int_set (&basesink->priv->to_playing, FALSE);
GST_DEBUG_OBJECT (basesink, "PLAYING to PAUSED");
/* FIXME, make sure we cannot enter _render first */
diff --git a/tests/check/elements/filesrc.c b/tests/check/elements/filesrc.c
index 4c989622ca..3ad59981f0 100644
--- a/tests/check/elements/filesrc.c
+++ b/tests/check/elements/filesrc.c
@@ -443,6 +443,9 @@ GST_START_TEST (test_uri_query)
check_uri_for_location (src, "./foo", NULL);
check_uri_for_location (src, "../foo", NULL);
check_uri_for_location (src, "foo/./bar", NULL);
+ /* make sure non-ASCII characters are escaped properly (U+00F6 here) */
+ check_uri_for_location (src, "/i/./d\303\266/not/../exist",
+ "file:///i/d%C3%B6/exist");
}
#endif