From 29487094ccd2444da3436bb40cd0f5dd5465b5d1 Mon Sep 17 00:00:00 2001 From: jim thornton Date: Tue, 2 Apr 2002 16:43:08 +0000 Subject: Fix: don't try to mangle a read-only buffer. This was causing SEGV when volume fed from wavparse from filesrc (which... Original commit message from CVS: patch from jim thornton : Fix: don't try to mangle a read-only buffer. This was causing SEGV when volume fed from wavparse from filesrc (which mmaps the file read-only) --- common | 2 +- gst/volume/gstvolume.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/common b/common index 38267abf5..6148068f2 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 38267abf56a3428093cea71429dca6a24a927547 +Subproject commit 6148068f2318e85d8e66df485342b630d8fb49ac diff --git a/gst/volume/gstvolume.c b/gst/volume/gstvolume.c index 5ed22387b..02f85613b 100644 --- a/gst/volume/gstvolume.c +++ b/gst/volume/gstvolume.c @@ -255,6 +255,9 @@ volume_chain (GstPad *pad, GstBuffer *buf) g_return_if_fail(filter != NULL); g_return_if_fail(GST_IS_VOLUME(filter)); + if (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_READONLY)) + buf = gst_buffer_copy (buf); + switch (filter->format) { case GST_VOLUME_FORMAT_INT: int_data = (gint16 *)GST_BUFFER_DATA(buf); @@ -314,6 +317,7 @@ volume_set_property (GObject *object, guint prop_id, const GValue *value, GParam filter->volume_i = filter->volume_f*8192; break; default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } -- cgit v1.2.1