--- gst/gstbuffer.c.orig	2006-07-11 22:16:04.000000000 +0200
+++ gst/gstbuffer.c	2006-08-15 10:49:42.000000000 +0200
@@ -376,9 +376,18 @@ gst_buffer_make_metadata_writable (GstBu
   if (gst_buffer_is_metadata_writable (buf)) {
     ret = buf;
   } else {
     ret = gst_buffer_create_sub (buf, 0, GST_BUFFER_SIZE (buf));
+
     GST_BUFFER_FLAGS (ret) = GST_BUFFER_FLAGS (buf);
     GST_BUFFER_FLAG_UNSET (ret, GST_BUFFER_FLAG_IN_CAPS);
+    GST_BUFFER_FLAG_SET (ret, GST_BUFFER_FLAG_READONLY);
+
+    GST_BUFFER_DURATION (ret) = GST_BUFFER_DURATION (buf);
+    GST_BUFFER_OFFSET_END (ret) = GST_BUFFER_OFFSET_END (buf);
+
+    if (GST_BUFFER_CAPS (buf))
+      GST_BUFFER_CAPS (ret) = gst_caps_ref (GST_BUFFER_CAPS (buf));
+
     gst_buffer_unref (buf);
   }
 
