summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjim thornton <jthornton@parc.com>2002-04-02 16:43:08 +0000
committerAndy Wingo <wingo@pobox.com>2002-04-02 16:43:08 +0000
commit29487094ccd2444da3436bb40cd0f5dd5465b5d1 (patch)
treefe87337447f5ccb7a0914feb2d457dd767b4a130
parent2d698ba7d22e9c275c603dbb8ceb364596287862 (diff)
downloadgstreamer-plugins-base-29487094ccd2444da3436bb40cd0f5dd5465b5d1.tar.gz
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 <jthornton@parc.com>: 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)
m---------common0
-rw-r--r--gst/volume/gstvolume.c4
2 files changed, 4 insertions, 0 deletions
diff --git a/common b/common
-Subproject 38267abf56a3428093cea71429dca6a24a92754
+Subproject 6148068f2318e85d8e66df485342b630d8fb49a
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;
}
}