Commit a27cc4ad authored by Mark Nauwelaerts's avatar Mark Nauwelaerts Committed by Tim-Philipp Müller
Browse files

baseparse: restrict duration scanning to pull mode and avoid extra set_caps call

parent efe6f065
...@@ -1422,7 +1422,8 @@ gst_base_parse_handle_and_push_buffer (GstBaseParse * parse, ...@@ -1422,7 +1422,8 @@ gst_base_parse_handle_and_push_buffer (GstBaseParse * parse,
/* check initial frame to determine if subclass/format can provide ts. /* check initial frame to determine if subclass/format can provide ts.
* If so, that allows and enables extra seek and duration determining options */ * 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 (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_offset = offset;
parse->priv->first_frame_ts = GST_BUFFER_TIMESTAMP (buffer); parse->priv->first_frame_ts = GST_BUFFER_TIMESTAMP (buffer);
GST_DEBUG_OBJECT (parse, "subclass provided ts %" GST_TIME_FORMAT GST_DEBUG_OBJECT (parse, "subclass provided ts %" GST_TIME_FORMAT
...@@ -3497,7 +3498,7 @@ gst_base_parse_sink_setcaps (GstPad * pad, GstCaps * caps) ...@@ -3497,7 +3498,7 @@ gst_base_parse_sink_setcaps (GstPad * pad, GstCaps * caps)
if (klass->set_sink_caps) if (klass->set_sink_caps)
res = klass->set_sink_caps (parse, caps); res = klass->set_sink_caps (parse, caps);
return res && gst_pad_set_caps (pad, caps); return res;
} }
static void static void
......
...@@ -234,11 +234,6 @@ struct _GstBaseParseClass { ...@@ -234,11 +234,6 @@ struct _GstBaseParseClass {
GstFormat dest_format, GstFormat dest_format,
gint64 * dest_value); gint64 * dest_value);
gboolean (*find_frame) (GstBaseParse *parse,
GstFormat src_format,
gint64 src_value,
gint64 * dest_value);
gboolean (*event) (GstBaseParse *parse, gboolean (*event) (GstBaseParse *parse,
GstEvent *event); GstEvent *event);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment