From f47c3472df2100d0339c622fa384dd83c280d5a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 7 Jul 2011 14:57:18 +0100 Subject: [PATCH 1/7] baseparse: fix invalid memory access in debug messages Don't use buffers that we've given away or unrefed in debug messages. --- libs/gst/base/gstbaseparse.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index e0158ce119..8772aad1cc 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -1925,9 +1925,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) { - ret = gst_pad_push (parse->srcpad, buffer); - GST_LOG_OBJECT (parse, "frame (%d bytes) pushed: %s", + GST_LOG_OBJECT (parse, "pushing frame (%d bytes) now..", GST_BUFFER_SIZE (buffer), gst_flow_get_name (ret)); + ret = gst_pad_push (parse->srcpad, buffer); + GST_LOG_OBJECT (parse, "frame pushed, flow %s", gst_flow_get_name (ret)); } else { GST_LOG_OBJECT (parse, "frame (%d bytes) queued for now", GST_BUFFER_SIZE (buffer)); @@ -1936,9 +1937,9 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) ret = GST_FLOW_OK; } } else { - gst_buffer_unref (buffer); GST_LOG_OBJECT (parse, "frame (%d bytes) not pushed: %s", GST_BUFFER_SIZE (buffer), 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 || From c8b92755781b652862d7d2a15cfe5860ed8fe2a5 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Mon, 4 Jul 2011 12:58:54 +0200 Subject: [PATCH 2/7] basesink: try harder to arrange increasing position reporting ... rather than having a momentary decreasing one while transitioning to PLAYING. Fixes #628021. --- libs/gst/base/gstbasesink.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index d60ba6fdfd..b9f2f7cbaf 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -231,6 +231,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; @@ -4584,6 +4586,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; @@ -4988,6 +4998,7 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition) break; case GST_STATE_CHANGE_PAUSED_TO_PLAYING: GST_PAD_PREROLL_LOCK (basesink->sinkpad); + 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. */ @@ -5034,6 +5045,7 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition) switch (transition) { 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 */ From 27313d05c13a9bb1631fad52bb5c10abac6df4b5 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Wed, 13 Jul 2011 11:39:15 +0200 Subject: [PATCH 3/7] basesink: unset PLAYING transition flag when transition completed --- libs/gst/base/gstbasesink.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index b9f2f7cbaf..4d4deaef2a 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -5044,6 +5044,12 @@ 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"); From 59441b36b676604d65f0efe83a26dbee9ab47eb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 14 Jul 2011 12:45:33 +0100 Subject: [PATCH 4/7] baseparse: fix printf format in debug message --- libs/gst/base/gstbaseparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index 8772aad1cc..59865c2775 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -1926,7 +1926,7 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) } else if (ret == GST_FLOW_OK) { if (parse->segment.rate > 0.0) { GST_LOG_OBJECT (parse, "pushing frame (%d bytes) now..", - GST_BUFFER_SIZE (buffer), gst_flow_get_name (ret)); + GST_BUFFER_SIZE (buffer)); ret = gst_pad_push (parse->srcpad, buffer); GST_LOG_OBJECT (parse, "frame pushed, flow %s", gst_flow_get_name (ret)); } else { From 5164d5b5bf20e6ba962e21abbf21de2f60a8c79f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 16 Jul 2011 12:21:12 +0100 Subject: [PATCH 5/7] tests: make sure non-ASCII chars in filenames are escaped when creating URIs from them https://bugzilla.gnome.org/show_bug.cgi?id=654673 --- tests/check/elements/filesrc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/check/elements/filesrc.c b/tests/check/elements/filesrc.c index 970ca9ad0b..d751acf167 100644 --- a/tests/check/elements/filesrc.c +++ b/tests/check/elements/filesrc.c @@ -437,6 +437,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 From 43f56243342b5420418902868108e23fac72c76c Mon Sep 17 00:00:00 2001 From: Raluca Elena Podiuc Date: Sat, 16 Jul 2011 22:00:15 +0300 Subject: [PATCH 6/7] docs: removed double negation in event/message seq num description https://bugzilla.gnome.org/show_bug.cgi?id=654751 --- gst/gstevent.c | 2 +- gst/gstmessage.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gst/gstevent.c b/gst/gstevent.c index 07414c7fa4..7e28e9192a 100644 --- a/gst/gstevent.c +++ b/gst/gstevent.c @@ -369,7 +369,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 e151042302..e6b6019b0e 100644 --- a/gst/gstmessage.c +++ b/gst/gstmessage.c @@ -301,7 +301,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. From 70b95be8f0c65fd19f8cf7078f04a72014ba56a4 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Mon, 18 Jul 2011 17:22:41 +0200 Subject: [PATCH 7/7] docs: clarify clocks docs in manual After a question on the mailing list, mention that *flushing* seeks reset the running time. --- docs/manual/advanced-clocks.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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.