From: <tp...@ke...> - 2009-08-01 18:20:05
|
Module: gst-plugins-good Branch: master Commit: e8badc068687e2c947f58efa9fadd48626c009fb URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=e8badc068687e2c947f58efa9fadd48626c009fb Author: Tim-Philipp Müller <tim...@co...> Date: Sat Aug 1 15:22:49 2009 +0100 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. --- ext/flac/gstflacdec.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c index 50e2903..7905a74 100644 --- a/ext/flac/gstflacdec.c +++ b/ext/flac/gstflacdec.c @@ -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)", 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; gst_adapter_flush (dec->adapter, len); |