baseparse: make estimating the position in query handler actually work

No point estimating if we don't set the result afterwards.
This commit is contained in:
Tim-Philipp Müller 2011-09-30 15:25:20 +01:00
parent f94701261a
commit 0ac0b70c15

View file

@ -3163,14 +3163,14 @@ gst_base_parse_query (GstPad * pad, GstQuery * query)
res = TRUE; res = TRUE;
} }
GST_OBJECT_UNLOCK (parse); GST_OBJECT_UNLOCK (parse);
if (res) if (!res) {
gst_query_set_position (query, format, dest_value);
else {
/* no precise result, upstream no idea either, then best estimate */ /* no precise result, upstream no idea either, then best estimate */
/* priv->offset is updated in both PUSH/PULL modes */ /* priv->offset is updated in both PUSH/PULL modes */
res = gst_base_parse_convert (parse, res = gst_base_parse_convert (parse,
GST_FORMAT_BYTES, parse->priv->offset, format, &dest_value); GST_FORMAT_BYTES, parse->priv->offset, format, &dest_value);
} }
if (res)
gst_query_set_position (query, format, dest_value);
} }
break; break;
} }