From 7141ad3ce6adaeb73a86996236b96ed566a4ed3f Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Fri, 2 Mar 2012 12:16:03 +0100 Subject: [PATCH 01/11] consitencychecker: don't fail on multiple flush_start events This seems to be okay after a irc discussion. --- libs/gst/check/gstconsistencychecker.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/gst/check/gstconsistencychecker.c b/libs/gst/check/gstconsistencychecker.c index d916ef1922..242f9490e3 100644 --- a/libs/gst/check/gstconsistencychecker.c +++ b/libs/gst/check/gstconsistencychecker.c @@ -71,9 +71,9 @@ source_pad_data_cb (GstPad * pad, GstMiniObject * data, GST_DEBUG_OBJECT (pad, "%s", GST_EVENT_TYPE_NAME (event)); switch (GST_EVENT_TYPE (event)) { case GST_EVENT_FLUSH_START: - /* FIXME : not 100% sure about whether getting two flush_start in a row - * is valid */ - fail_if (consist->flushing, "Received another FLUSH_START"); + /* getting two flush_start in a row seems to be okay + fail_if (consist->flushing, "Received another FLUSH_START"); + */ consist->flushing = TRUE; break; case GST_EVENT_FLUSH_STOP: From 17985ac85e3eb39a60398505cc6a9ac229d07569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 5 Mar 2012 00:34:36 +0000 Subject: [PATCH 02/11] libgstcheck: export gst_consistency_checker_add_pad() Fix build of the adder unit test in -base again. --- libs/gst/check/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/gst/check/Makefile.am b/libs/gst/check/Makefile.am index 8dcf66d727..6115d99022 100644 --- a/libs/gst/check/Makefile.am +++ b/libs/gst/check/Makefile.am @@ -83,6 +83,7 @@ LIBGSTCHECK_EXPORTED_FUNCS = \ gst_check_teardown_pad_by_name \ gst_check_teardown_sink_pad \ gst_check_teardown_src_pad \ + gst_consistency_checker_add_pad \ gst_consistency_checker_new \ gst_consistency_checker_reset \ gst_consistency_checker_free From cd195f2143d0dd4a59658412d429bc9deadbcca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 5 Mar 2012 13:00:38 +0100 Subject: [PATCH 03/11] baseparse: Only queue serialized events for sending them later --- libs/gst/base/gstbaseparse.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index 34a5ae70e1..81f459e8ad 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -910,9 +910,10 @@ gst_base_parse_sink_event (GstPad * pad, GstEvent * event) GST_DEBUG_OBJECT (parse, "handling event %d, %s", GST_EVENT_TYPE (event), GST_EVENT_TYPE_NAME (event)); - /* Cache all events except EOS, NEWSEGMENT and FLUSH_STOP if we have a + /* Cache all serialized events except EOS, NEWSEGMENT and FLUSH_STOP if we have a * pending segment */ - if (parse->priv->pending_segment && GST_EVENT_TYPE (event) != GST_EVENT_EOS + if (parse->priv->pending_segment && GST_EVENT_IS_SERIALIZED (event) + && GST_EVENT_TYPE (event) != GST_EVENT_EOS && GST_EVENT_TYPE (event) != GST_EVENT_NEWSEGMENT && GST_EVENT_TYPE (event) != GST_EVENT_FLUSH_START && GST_EVENT_TYPE (event) != GST_EVENT_FLUSH_STOP) { From 13930dad5344e0e915d32dfb0897fc6a820a59b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 5 Mar 2012 13:12:18 +0100 Subject: [PATCH 04/11] baseparse: Clear some more state when receiving FLUSH_STOP Like pending serialized events and the currently cached buffer. --- libs/gst/base/gstbaseparse.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index 81f459e8ad..de96241596 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -460,6 +460,14 @@ gst_base_parse_clear_queues (GstBaseParse * parse) g_queue_foreach (&parse->priv->queued_frames, (GFunc) gst_base_parse_frame_free, NULL); g_queue_clear (&parse->priv->queued_frames); + + gst_buffer_replace (&parse->priv->cache, NULL); + + g_list_foreach (parse->priv->pending_events, (GFunc) gst_event_unref, NULL); + g_list_free (parse->priv->pending_events); + parse->priv->pending_seeks = NULL; + + gst_event_replace (&parse->priv->pending_segment, NULL); } static void From 747dfc09b26739805f0e6d09e9f1883193317571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 5 Mar 2012 14:23:17 +0100 Subject: [PATCH 05/11] baseparse: Remove obsolete code and move gap handling to the correct place The segment start adjustment code in pull mode should never trigger anymore because the bisection code earlier would have already made sure that we're at the desired position. Also move the gap handling some lines below after sending the currently configured segments. Otherwise we might fill gaps in a segment that is not configured downstream yet. --- libs/gst/base/gstbaseparse.c | 125 ++++++++++++++--------------------- 1 file changed, 51 insertions(+), 74 deletions(-) diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index de96241596..9598649809 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -1836,76 +1836,6 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) /* should have caps by now */ g_return_val_if_fail (GST_PAD_CAPS (parse->srcpad), GST_FLOW_ERROR); - /* segment adjustment magic; only if we are running the whole show */ - if (!parse->priv->passthrough && parse->segment.rate > 0.0 && - (parse->priv->pad_mode == GST_ACTIVATE_PULL || - parse->priv->upstream_seekable)) { - /* segment times are typically estimates, - * actual frame data might lead subclass to different timestamps, - * so override segment start from what is supplied there */ - if (G_UNLIKELY (parse->priv->pending_segment && !parse->priv->exact_position - && GST_CLOCK_TIME_IS_VALID (last_start))) { - gst_event_unref (parse->priv->pending_segment); - parse->segment.start = - MIN ((guint64) last_start, (guint64) parse->segment.stop); - GST_DEBUG_OBJECT (parse, - "adjusting pending segment start to %" GST_TIME_FORMAT, - GST_TIME_ARGS (parse->segment.start)); - parse->priv->pending_segment = - gst_event_new_new_segment (FALSE, parse->segment.rate, - parse->segment.format, parse->segment.start, - parse->segment.stop, parse->segment.start); - } - /* handle gaps, e.g. non-zero start-time, in as much not handled by above */ - if (GST_CLOCK_TIME_IS_VALID (parse->segment.last_stop) && - GST_CLOCK_TIME_IS_VALID (last_start)) { - GstClockTimeDiff diff; - - /* only send newsegments with increasing start times, - * otherwise if these go back and forth downstream (sinks) increase - * accumulated time and running_time */ - diff = GST_CLOCK_DIFF (parse->segment.last_stop, last_start); - if (G_UNLIKELY (diff > 2 * GST_SECOND - && last_start > parse->segment.start - && (!GST_CLOCK_TIME_IS_VALID (parse->segment.stop) - || last_start < parse->segment.stop))) { - GST_DEBUG_OBJECT (parse, - "Gap of %" G_GINT64_FORMAT " ns detected in stream " "(%" - GST_TIME_FORMAT " -> %" GST_TIME_FORMAT "). " - "Sending updated NEWSEGMENT events", diff, - GST_TIME_ARGS (parse->segment.last_stop), - GST_TIME_ARGS (last_start)); - if (G_UNLIKELY (parse->priv->pending_segment)) { - gst_event_unref (parse->priv->pending_segment); - parse->segment.start = last_start; - parse->priv->pending_segment = - gst_event_new_new_segment (FALSE, parse->segment.rate, - parse->segment.format, parse->segment.start, - parse->segment.stop, parse->segment.start); - } else { - /* send newsegment events such that the gap is not accounted in - * accum time, hence running_time */ - /* close ahead of gap */ - gst_pad_push_event (parse->srcpad, - gst_event_new_new_segment (TRUE, parse->segment.rate, - parse->segment.format, parse->segment.last_stop, - parse->segment.last_stop, parse->segment.last_stop)); - /* skip gap */ - gst_pad_push_event (parse->srcpad, - gst_event_new_new_segment (FALSE, parse->segment.rate, - parse->segment.format, last_start, - parse->segment.stop, last_start)); - } - /* align segment view with downstream, - * prevents double-counting accum when closing segment */ - gst_segment_set_newsegment (&parse->segment, FALSE, - parse->segment.rate, parse->segment.format, last_start, - parse->segment.stop, last_start); - parse->segment.last_stop = last_start; - } - } - } - /* and should then also be linked downstream, so safe to send some events */ if (G_UNLIKELY (parse->priv->close_segment)) { /* only set up by loop */ @@ -1927,10 +1857,6 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) gst_base_parse_check_media (parse); } - /* update bitrates and optionally post corresponding tags - * (following newsegment) */ - gst_base_parse_update_bitrates (parse, frame); - if (G_UNLIKELY (parse->priv->pending_events)) { GList *l; @@ -1941,6 +1867,57 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) parse->priv->pending_events = NULL; } + /* segment adjustment magic; only if we are running the whole show */ + if (!parse->priv->passthrough && parse->segment.rate > 0.0 && + (parse->priv->pad_mode == GST_ACTIVATE_PULL || + parse->priv->upstream_seekable)) { + /* handle gaps */ + if (GST_CLOCK_TIME_IS_VALID (parse->segment.last_stop) && + GST_CLOCK_TIME_IS_VALID (last_start)) { + GstClockTimeDiff diff; + + /* only send newsegments with increasing start times, + * otherwise if these go back and forth downstream (sinks) increase + * accumulated time and running_time */ + diff = GST_CLOCK_DIFF (parse->segment.last_stop, last_start); + if (G_UNLIKELY (diff > 2 * GST_SECOND + && last_start > parse->segment.start + && (!GST_CLOCK_TIME_IS_VALID (parse->segment.stop) + || last_start < parse->segment.stop))) { + GST_DEBUG_OBJECT (parse, + "Gap of %" G_GINT64_FORMAT " ns detected in stream " "(%" + GST_TIME_FORMAT " -> %" GST_TIME_FORMAT "). " + "Sending updated NEWSEGMENT events", diff, + GST_TIME_ARGS (parse->segment.last_stop), + GST_TIME_ARGS (last_start)); + + /* send newsegment events such that the gap is not accounted in + * accum time, hence running_time */ + /* close ahead of gap */ + gst_pad_push_event (parse->srcpad, + gst_event_new_new_segment (TRUE, parse->segment.rate, + parse->segment.format, parse->segment.last_stop, + parse->segment.last_stop, parse->segment.last_stop)); + /* skip gap */ + gst_pad_push_event (parse->srcpad, + gst_event_new_new_segment (FALSE, parse->segment.rate, + parse->segment.format, last_start, + parse->segment.stop, last_start)); + + /* align segment view with downstream, + * prevents double-counting accum when closing segment */ + gst_segment_set_newsegment (&parse->segment, FALSE, + parse->segment.rate, parse->segment.format, last_start, + parse->segment.stop, last_start); + parse->segment.last_stop = last_start; + } + } + } + + /* update bitrates and optionally post corresponding tags + * (following newsegment) */ + gst_base_parse_update_bitrates (parse, frame); + if (klass->pre_push_frame) { ret = klass->pre_push_frame (parse, frame); } else { From 563ba031a2a2fb9d856e3f2b8c2be1eceac7ec86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 5 Mar 2012 14:25:57 +0100 Subject: [PATCH 06/11] baseparse: Also flush the close_segment Pushing this after flushing will confuse downstream. --- libs/gst/base/gstbaseparse.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index 9598649809..bcb2a9a053 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -465,9 +465,10 @@ gst_base_parse_clear_queues (GstBaseParse * parse) g_list_foreach (parse->priv->pending_events, (GFunc) gst_event_unref, NULL); g_list_free (parse->priv->pending_events); - parse->priv->pending_seeks = NULL; + parse->priv->pending_events = NULL; gst_event_replace (&parse->priv->pending_segment, NULL); + gst_event_replace (&parse->priv->close_segment, NULL); } static void @@ -775,6 +776,8 @@ gst_base_parse_reset (GstBaseParse * parse) g_list_free (parse->priv->pending_events); parse->priv->pending_events = NULL; + gst_event_replace (&parse->priv->close_segment, NULL); + if (parse->priv->cache) { gst_buffer_unref (parse->priv->cache); parse->priv->cache = NULL; From 495aca4905a971e91f219b5d39a9e37746c8713d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 5 Mar 2012 14:41:12 +0100 Subject: [PATCH 07/11] baseparse: Fix handling of multiple newsegment events Previously only the last would be pushed, which would cause invalid running times downstream. This also fixes the handling of update newsegment events. --- libs/gst/base/gstbaseparse.c | 96 ++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index bcb2a9a053..851ec1da55 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -276,8 +276,6 @@ struct _GstBaseParsePrivate guint max_bitrate; guint posted_avg_bitrate; - GList *pending_events; - /* frames/buffers that are queued and ready to go on OK */ GQueue queued_frames; @@ -316,9 +314,10 @@ struct _GstBaseParsePrivate GstClockTime last_ts; gint64 last_offset; + /* Pending serialized events */ + GList *pending_events; /* Newsegment event to be sent after SEEK */ - GstEvent *pending_segment; - + gboolean pending_segment; /* Segment event that closes the running segment prior to SEEK */ GstEvent *close_segment; @@ -466,8 +465,8 @@ gst_base_parse_clear_queues (GstBaseParse * parse) g_list_foreach (parse->priv->pending_events, (GFunc) gst_event_unref, NULL); g_list_free (parse->priv->pending_events); parse->priv->pending_events = NULL; + parse->priv->pending_segment = FALSE; - gst_event_replace (&parse->priv->pending_segment, NULL); gst_event_replace (&parse->priv->close_segment, NULL); } @@ -479,10 +478,6 @@ gst_base_parse_finalize (GObject * object) g_object_unref (parse->priv->adapter); - if (parse->priv->pending_segment) { - p_ev = &parse->priv->pending_segment; - gst_event_replace (p_ev, NULL); - } if (parse->priv->close_segment) { p_ev = &parse->priv->close_segment; gst_event_replace (p_ev, NULL); @@ -497,6 +492,7 @@ gst_base_parse_finalize (GObject * object) NULL); g_list_free (parse->priv->pending_events); parse->priv->pending_events = NULL; + parse->priv->pending_segment = FALSE; if (parse->priv->index) { gst_object_unref (parse->priv->index); @@ -766,15 +762,11 @@ gst_base_parse_reset (GstBaseParse * parse) parse->priv->last_ts = GST_CLOCK_TIME_NONE; parse->priv->last_offset = 0; - if (parse->priv->pending_segment) { - gst_event_unref (parse->priv->pending_segment); - parse->priv->pending_segment = NULL; - } - g_list_foreach (parse->priv->pending_events, (GFunc) gst_mini_object_unref, NULL); g_list_free (parse->priv->pending_events); parse->priv->pending_events = NULL; + parse->priv->pending_segment = FALSE; gst_event_replace (&parse->priv->close_segment, NULL); @@ -937,7 +929,6 @@ gst_base_parse_sink_event (GstPad * pad, GstEvent * event) g_list_append (parse->priv->pending_events, event); ret = TRUE; } else { - if (GST_EVENT_TYPE (event) == GST_EVENT_EOS && parse->priv->framecount < MIN_FRAMES_TO_POST_BITRATE) /* We've not posted bitrate tags yet - do so now */ @@ -974,7 +965,6 @@ static gboolean gst_base_parse_sink_eventfunc (GstBaseParse * parse, GstEvent * event) { gboolean handled = FALSE; - GstEvent **eventp; switch (GST_EVENT_TYPE (event)) { case GST_EVENT_NEWSEGMENT: @@ -1065,9 +1055,9 @@ gst_base_parse_sink_eventfunc (GstBaseParse * parse, GstEvent * event) /* save the segment for later, right before we push a new buffer so that * the caps are fixed and the next linked element can receive * the segment. */ - eventp = &parse->priv->pending_segment; - gst_event_replace (eventp, event); - gst_event_unref (event); + parse->priv->pending_events = + g_list_append (parse->priv->pending_events, event); + parse->priv->pending_segment = TRUE; handled = TRUE; /* but finish the current segment */ @@ -1119,10 +1109,16 @@ gst_base_parse_sink_eventfunc (GstBaseParse * parse, GstEvent * event) GST_ELEMENT_ERROR (parse, STREAM, WRONG_TYPE, ("No valid frames found before end of stream"), (NULL)); } - /* newsegment before eos */ - if (parse->priv->pending_segment) { - gst_pad_push_event (parse->srcpad, parse->priv->pending_segment); - parse->priv->pending_segment = NULL; + /* newsegment and other serialized events before eos */ + if (G_UNLIKELY (parse->priv->pending_events)) { + GList *l; + + for (l = parse->priv->pending_events; l != NULL; l = l->next) { + gst_pad_push_event (parse->srcpad, GST_EVENT (l->data)); + } + g_list_free (parse->priv->pending_events); + parse->priv->pending_events = NULL; + parse->priv->pending_segment = FALSE; } break; @@ -1839,6 +1835,11 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) /* should have caps by now */ g_return_val_if_fail (GST_PAD_CAPS (parse->srcpad), GST_FLOW_ERROR); + if (G_UNLIKELY (parse->priv->pending_segment)) { + /* have caps; check identity */ + gst_base_parse_check_media (parse); + } + /* and should then also be linked downstream, so safe to send some events */ if (G_UNLIKELY (parse->priv->close_segment)) { /* only set up by loop */ @@ -1846,20 +1847,8 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) gst_pad_push_event (parse->srcpad, parse->priv->close_segment); parse->priv->close_segment = NULL; } - if (G_UNLIKELY (parse->priv->pending_segment)) { - GstEvent *pending_segment; - - pending_segment = parse->priv->pending_segment; - parse->priv->pending_segment = NULL; - - GST_DEBUG_OBJECT (parse, "%s push pending segment", - parse->priv->pad_mode == GST_ACTIVATE_PULL ? "loop" : "chain"); - gst_pad_push_event (parse->srcpad, pending_segment); - - /* have caps; check identity */ - gst_base_parse_check_media (parse); - } + /* Push pending events, including NEWSEGMENT events */ if (G_UNLIKELY (parse->priv->pending_events)) { GList *l; @@ -1868,6 +1857,7 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame) } g_list_free (parse->priv->pending_events); parse->priv->pending_events = NULL; + parse->priv->pending_segment = FALSE; } /* segment adjustment magic; only if we are running the whole show */ @@ -2880,11 +2870,18 @@ pause: push_eos = TRUE; } if (push_eos) { - /* newsegment before eos */ - if (parse->priv->pending_segment) { - gst_pad_push_event (parse->srcpad, parse->priv->pending_segment); - parse->priv->pending_segment = NULL; + /* Push pending events, including NEWSEGMENT events */ + if (G_UNLIKELY (parse->priv->pending_events)) { + GList *l; + + for (l = parse->priv->pending_events; l != NULL; l = l->next) { + gst_pad_push_event (parse->srcpad, GST_EVENT (l->data)); + } + g_list_free (parse->priv->pending_events); + parse->priv->pending_events = NULL; + parse->priv->pending_segment = FALSE; } + gst_pad_push_event (parse->srcpad, gst_event_new_eos ()); } gst_object_unref (parse); @@ -2981,9 +2978,15 @@ gst_base_parse_sink_activate_pull (GstPad * sinkpad, gboolean active) if (result) { if (active) { - parse->priv->pending_segment = gst_event_new_new_segment (FALSE, + GstEvent *event; + + event = gst_event_new_new_segment (FALSE, parse->segment.rate, parse->segment.format, parse->segment.start, parse->segment.stop, parse->segment.last_stop); + parse->priv->pending_events = + g_list_append (parse->priv->pending_events, event); + parse->priv->pending_segment = TRUE; + result &= gst_pad_start_task (sinkpad, (GstTaskFunction) gst_base_parse_loop, sinkpad); @@ -3834,14 +3837,11 @@ gst_base_parse_handle_seek (GstBaseParse * parse, GstEvent * event) memcpy (&parse->segment, &seeksegment, sizeof (GstSegment)); /* store the newsegment event so it can be sent from the streaming thread. */ - if (parse->priv->pending_segment) - gst_event_unref (parse->priv->pending_segment); - - /* This will be sent later in _loop() */ - parse->priv->pending_segment = + parse->priv->pending_segment = TRUE; + parse->priv->pending_events = g_list_append (parse->priv->pending_events, gst_event_new_new_segment (FALSE, parse->segment.rate, - parse->segment.format, parse->segment.start, - parse->segment.stop, parse->segment.start); + parse->segment.format, parse->segment.start, + parse->segment.stop, parse->segment.start)); GST_DEBUG_OBJECT (parse, "Created newseg format %d, " "start = %" GST_TIME_FORMAT ", stop = %" GST_TIME_FORMAT From c8cde669b78f120cfe0a7181fd8f5508cbd249fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 6 Mar 2012 12:16:19 +0100 Subject: [PATCH 08/11] gst: Fix 'comparison of unsigned enum expression >= 0 is always true' compiler warning --- gst/gst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/gst.c b/gst/gst.c index ff7f2507ca..8e6c54280c 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -913,7 +913,7 @@ parse_one_option (gint opt, const gchar * arg, GError ** err) GstDebugLevel tmp = GST_LEVEL_NONE; tmp = (GstDebugLevel) strtol (arg, NULL, 0); - if (tmp >= 0 && tmp < GST_LEVEL_COUNT) { + if (((guint) tmp) < GST_LEVEL_COUNT) { gst_debug_set_default_threshold (tmp); } break; From 7c32cfd661abf01b94e007ee841fe8c655a40ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 6 Mar 2012 12:23:15 +0100 Subject: [PATCH 09/11] basetransform: Fix 'equality comparison with extraneous parentheses' compiler warning --- libs/gst/base/gstbasetransform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index dfaa359c80..e1fbaa98fd 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -2655,7 +2655,7 @@ gst_base_transform_chain (GstPad * pad, GstBuffer * buffer) /* outbuf can be NULL, this means a dropped buffer, if we have a buffer but * GST_BASE_TRANSFORM_FLOW_DROPPED we will not push either. */ if (outbuf != NULL) { - if ((ret == GST_FLOW_OK)) { + if (ret == GST_FLOW_OK) { GstClockTime last_stop_out = GST_CLOCK_TIME_NONE; /* Remember last stop position */ From f000bbe9248027083a8be3d1a31fc800fd752515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 6 Mar 2012 12:24:53 +0100 Subject: [PATCH 10/11] tee: Fix 'use of logical '&&' with constant operand' compiler warning This is actually a real bug. --- plugins/elements/gsttee.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c index 6b875a78a0..f1ec8a4f01 100644 --- a/plugins/elements/gsttee.c +++ b/plugins/elements/gsttee.c @@ -859,7 +859,7 @@ gst_tee_sink_activate_push (GstPad * pad, gboolean active) tee = GST_TEE (GST_OBJECT_PARENT (pad)); GST_OBJECT_LOCK (tee); - tee->sink_mode = active && GST_ACTIVATE_PUSH; + tee->sink_mode = (active ? GST_ACTIVATE_PUSH : GST_ACTIVATE_NONE); if (active && !tee->has_chain) goto no_chain; @@ -912,7 +912,7 @@ gst_tee_src_activate_pull (GstPad * pad, gboolean active) if (pad == tee->pull_pad) tee->pull_pad = NULL; } - tee->sink_mode = active && GST_ACTIVATE_PULL; + tee->sink_mode = (active ? GST_ACTIVATE_PULL : GST_ACTIVATE_NONE); GST_OBJECT_UNLOCK (tee); gst_object_unref (tee); From ed7f4802222234eef192aa3f74bc92268f338f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 6 Mar 2012 12:28:02 +0100 Subject: [PATCH 11/11] baseparse: Fix 'self-comparison always evaluates to true' This was really a bug. --- 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 851ec1da55..108ee89dd9 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -3899,7 +3899,7 @@ gst_base_parse_handle_seek (GstBaseParse * parse, GstEvent * event) seek event (in bytes) to upstream. Segment / flush handling happens in corresponding src event handlers */ GST_DEBUG_OBJECT (parse, "seek in PUSH mode"); - if (seekstop >= 0 && seekpos <= seekpos) + if (seekstop >= 0 && seekstop <= seekpos) seekstop = seekpos; new_event = gst_event_new_seek (rate, GST_FORMAT_BYTES, flags, GST_SEEK_TYPE_SET, seekpos, stop_type, seekstop);