mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
collectpads: avoid multiple calls to gst_buffer_get_size() in macro
This commit is contained in:
parent
4a1cee3c44
commit
68012b4d23
1 changed files with 3 additions and 2 deletions
|
@ -1131,7 +1131,7 @@ GstBuffer *
|
|||
gst_collect_pads_read_buffer (GstCollectPads * pads, GstCollectData * data,
|
||||
guint size)
|
||||
{
|
||||
guint readsize;
|
||||
guint readsize, buf_size;
|
||||
GstBuffer *buffer;
|
||||
|
||||
g_return_val_if_fail (pads != NULL, NULL);
|
||||
|
@ -1142,7 +1142,8 @@ gst_collect_pads_read_buffer (GstCollectPads * pads, GstCollectData * data,
|
|||
if ((buffer = data->buffer) == NULL)
|
||||
return NULL;
|
||||
|
||||
readsize = MIN (size, gst_buffer_get_size (buffer) - data->pos);
|
||||
buf_size = gst_buffer_get_size (buffer);
|
||||
readsize = MIN (size, buf_size - data->pos);
|
||||
|
||||
return gst_buffer_copy_region (buffer, GST_BUFFER_COPY_ALL, data->pos,
|
||||
readsize);
|
||||
|
|
Loading…
Reference in a new issue