baseparse: fix seekability querying with formats with headers like FLAC

Move code that checks for upstream seekability and all that to
the right place, otherwise it will never be done for formats
that have headers such as FLAC, as handle_and_push frame will
be called the first time only after headers have been processed
(and framecount is > 0). This then makes us report that we
can't seek, which disables the seek bar in totem.
This commit is contained in:
Tim-Philipp Müller 2012-07-15 12:59:44 +01:00
parent f72ba83a84
commit 49ab4d9a45

View file

@ -1838,12 +1838,6 @@ gst_base_parse_handle_and_push_frame (GstBaseParse * parse,
g_return_val_if_fail (frame != NULL, GST_FLOW_ERROR);
/* some one-time start-up */
if (G_UNLIKELY (!parse->priv->framecount)) {
gst_base_parse_check_seekability (parse);
gst_base_parse_check_upstream (parse);
}
buffer = frame->buffer;
offset = frame->offset;
@ -2148,6 +2142,12 @@ gst_base_parse_finish_frame (GstBaseParse * parse, GstBaseParseFrame * frame,
GST_LOG_OBJECT (parse, "finished frame at offset %" G_GUINT64_FORMAT ", "
"flushing size %d", frame->offset, size);
/* some one-time start-up */
if (G_UNLIKELY (parse->priv->framecount == 0)) {
gst_base_parse_check_seekability (parse);
gst_base_parse_check_upstream (parse);
}
if (parse->priv->scanning && frame->buffer) {
if (!parse->priv->scanned_frame) {
parse->priv->scanned_frame = gst_base_parse_frame_copy (frame);