mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
flacdec: use gst_adapter_copy() to avoid unnecessary buffer merges
gst_adapter_peek() will merge buffers as needed, which we can avoid here since we're doing a memcpy anyway and then flush the copied data from the adapter right away.
This commit is contained in:
parent
33b686974e
commit
e8badc0686
1 changed files with 1 additions and 1 deletions
|
@ -809,7 +809,7 @@ gst_flac_dec_read_stream (const FLAC__StreamDecoder * decoder,
|
||||||
|
|
||||||
GST_LOG_OBJECT (dec, "feeding %u bytes to decoder (available=%u, bytes=%u)",
|
GST_LOG_OBJECT (dec, "feeding %u bytes to decoder (available=%u, bytes=%u)",
|
||||||
len, gst_adapter_available (dec->adapter), (guint) * bytes);
|
len, gst_adapter_available (dec->adapter), (guint) * bytes);
|
||||||
memcpy (buffer, gst_adapter_peek (dec->adapter, len), len);
|
gst_adapter_copy (dec->adapter, buffer, 0, len);
|
||||||
*bytes = len;
|
*bytes = len;
|
||||||
|
|
||||||
gst_adapter_flush (dec->adapter, len);
|
gst_adapter_flush (dec->adapter, len);
|
||||||
|
|
Loading…
Reference in a new issue