From 113db7f5766aeb4d732cd2f3f10fc9eb03cabc71 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Fri, 30 Aug 2002 15:30:04 +0000 Subject: copy_on_write Original commit message from CVS: copy_on_write --- gst/filter/gstiir.c | 3 +++ gst/filter/gstlpwsinc.c | 3 +++ 2 files changed, 6 insertions(+) (limited to 'gst') diff --git a/gst/filter/gstiir.c b/gst/filter/gstiir.c index 0bbcb050..c363802c 100644 --- a/gst/filter/gstiir.c +++ b/gst/filter/gstiir.c @@ -193,6 +193,9 @@ gst_iir_chain (GstPad * pad, GstBuffer * buf) src = (gfloat *) GST_BUFFER_DATA (buf); + /* get a writable buffer */ + buf = gst_buffer_copy_on_write (buf); + /* do an in-place edit */ for (i = 0; i < GST_BUFFER_SIZE (buf) / sizeof (gfloat); ++i) *(src + i) = (gfloat) IIR_filter (filter->state, (double) *(src + i)); diff --git a/gst/filter/gstlpwsinc.c b/gst/filter/gstlpwsinc.c index 9a0b65e1..fc916a82 100644 --- a/gst/filter/gstlpwsinc.c +++ b/gst/filter/gstlpwsinc.c @@ -234,6 +234,9 @@ gst_lpwsinc_chain (GstPad * pad, GstBuffer * buf) * to make amends we keep the incoming buffer around and write our * output samples there */ + /* get a writable buffer */ + buf = gst_buffer_copy_on_write (buf); + src = (gfloat *) GST_BUFFER_DATA (buf); residue_samples = filter->wing_size * 2 + 1; input_samples = GST_BUFFER_SIZE (buf) / sizeof (gfloat); -- cgit v1.2.1