mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 07:16:55 +00:00
typefindhelper: Avoid using buffer_get_size in tight loops
Calling gst_buffer_get_size represented 2/3 of the cost of helper_find_peek which was called whenever a typefindfunction wanted to peek at data. We already know the size (from the GstMapInfo), so just use that.
This commit is contained in:
parent
964012bbe7
commit
991d6462a8
1 changed files with 1 additions and 1 deletions
|
@ -116,7 +116,7 @@ helper_find_peek (gpointer data, gint64 offset, guint size)
|
||||||
GstBuffer *buf = GST_BUFFER_CAST (bmp->buffer);
|
GstBuffer *buf = GST_BUFFER_CAST (bmp->buffer);
|
||||||
|
|
||||||
buf_offset = GST_BUFFER_OFFSET (buf);
|
buf_offset = GST_BUFFER_OFFSET (buf);
|
||||||
buf_size = gst_buffer_get_size (buf);
|
buf_size = bmp->map.size;
|
||||||
|
|
||||||
/* buffers are kept sorted by end offset (highest first) in the list, so
|
/* buffers are kept sorted by end offset (highest first) in the list, so
|
||||||
* at this point we save the current position and stop searching if
|
* at this point we save the current position and stop searching if
|
||||||
|
|
Loading…
Reference in a new issue