mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
flacparse: Request at least the full header size when parsing headers
Otherwise baseparse will incrementally send us bigger buffers until the full header size is reached, which is not only pointless but also means that baseparse will reallocate and copy into a bigger buffer for every input buffers. In pull mode that's done in 64kb increments, in push mode usually in much smaller increments, causing a lot of overhead for example when parsing high-quality coverart.
This commit is contained in:
parent
a315810640
commit
b02350bd62
1 changed files with 4 additions and 0 deletions
|
@ -793,6 +793,7 @@ gst_flac_parse_handle_frame (GstBaseParse * parse,
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (flacparse, "Found metadata block of size %u", size);
|
GST_DEBUG_OBJECT (flacparse, "Found metadata block of size %u", size);
|
||||||
framesize = size;
|
framesize = size;
|
||||||
|
gst_base_parse_set_min_frame_size (GST_BASE_PARSE (flacparse), framesize);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1605,6 +1606,9 @@ gst_flac_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame,
|
||||||
|
|
||||||
if (res != GST_FLOW_OK)
|
if (res != GST_FLOW_OK)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
} else {
|
||||||
|
/* Header length */
|
||||||
|
gst_base_parse_set_min_frame_size (GST_BASE_PARSE (flacparse), 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DROPPED because we pushed already or will push all headers manually */
|
/* DROPPED because we pushed already or will push all headers manually */
|
||||||
|
|
Loading…
Reference in a new issue