copy_on_write

Original commit message from CVS:
copy_on_write
This commit is contained in:
Thomas Vander Stichele 2002-08-30 15:30:04 +00:00
parent 34f5ea6d6e
commit 113db7f576
2 changed files with 6 additions and 0 deletions

View file

@ -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));

View file

@ -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);