From: Mark Nauwelaerts Date: Fri, 7 Jan 2011 15:39:51 +0000 (+0100) Subject: baseparse: restrict duration scanning to pull mode and avoid extra set_caps call X-Git-Tag: RELEASE-0.10.33~114 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a27cc4ad834d3f9bb7986038dc5ecc20394f56c3;p=platform%2Fupstream%2Fgstreamer.git baseparse: restrict duration scanning to pull mode and avoid extra set_caps call --- diff --git a/gst/audioparsers/gstbaseparse.c b/gst/audioparsers/gstbaseparse.c index 23a06e3..8f7a5d5 100644 --- a/gst/audioparsers/gstbaseparse.c +++ b/gst/audioparsers/gstbaseparse.c @@ -1422,7 +1422,8 @@ gst_base_parse_handle_and_push_buffer (GstBaseParse * parse, /* check initial frame to determine if subclass/format can provide ts. * If so, that allows and enables extra seek and duration determining options */ if (G_UNLIKELY (parse->priv->first_frame_offset < 0 && ret == GST_FLOW_OK)) { - if (GST_BUFFER_TIMESTAMP_IS_VALID (buffer)) { + if (GST_BUFFER_TIMESTAMP_IS_VALID (buffer) && + parse->priv->pad_mode == GST_ACTIVATE_PULL) { parse->priv->first_frame_offset = offset; parse->priv->first_frame_ts = GST_BUFFER_TIMESTAMP (buffer); GST_DEBUG_OBJECT (parse, "subclass provided ts %" GST_TIME_FORMAT @@ -3497,7 +3498,7 @@ gst_base_parse_sink_setcaps (GstPad * pad, GstCaps * caps) if (klass->set_sink_caps) res = klass->set_sink_caps (parse, caps); - return res && gst_pad_set_caps (pad, caps); + return res; } static void diff --git a/gst/audioparsers/gstbaseparse.h b/gst/audioparsers/gstbaseparse.h index 6b45fd3..5a4b674 100644 --- a/gst/audioparsers/gstbaseparse.h +++ b/gst/audioparsers/gstbaseparse.h @@ -234,11 +234,6 @@ struct _GstBaseParseClass { GstFormat dest_format, gint64 * dest_value); - gboolean (*find_frame) (GstBaseParse *parse, - GstFormat src_format, - gint64 src_value, - gint64 * dest_value); - gboolean (*event) (GstBaseParse *parse, GstEvent *event);