gst/elements/gstfilesrc.c: Set READONLY flag on mmap'ed buffers, otherwise gst_buffer...
authorTim-Philipp Müller <tim@centricular.net>
Wed, 31 Aug 2005 12:55:54 +0000 (12:55 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Wed, 31 Aug 2005 12:55:54 +0000 (12:55 +0000)
Original commit message from CVS:
* gst/elements/gstfilesrc.c: (gst_mmap_buffer_init),
(gst_file_src_map_region):
Set READONLY flag on mmap'ed buffers, otherwise
gst_buffer_make_writable() won't work properly (#314708).

ChangeLog
gst/elements/gstfilesrc.c
plugins/elements/gstfilesrc.c

index 31042a1..a890cb6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-08-31  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * gst/elements/gstfilesrc.c: (gst_mmap_buffer_init),
+       (gst_file_src_map_region):
+         Set READONLY flag on mmap'ed buffers, otherwise
+         gst_buffer_make_writable() won't work properly (#314708).
+
 2005-08-31  Wim Taymans  <wim@fluendo.com>
 
        * gst/base/gstbasetransform.c: (gst_base_transform_handle_buffer):
index 6e177f1..6106f9b 100644 (file)
@@ -429,7 +429,12 @@ gst_mmap_buffer_class_init (gpointer g_class, gpointer class_data)
 static void
 gst_mmap_buffer_init (GTypeInstance * instance, gpointer g_class)
 {
+  GstBuffer *buf = (GstBuffer *) instance;
 
+  GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_READONLY);
+  /* before we re-enable this flag, we probably need to fix _copy()
+   * _make_writable(), etc. in GstMiniObject/GstBuffer as well */
+  /* GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_ORIGINAL); */
 }
 
 static void
@@ -500,9 +505,6 @@ gst_file_src_map_region (GstFileSrc * src, off_t offset, size_t size)
 #endif
 
   /* fill in the rest of the fields */
-  /* FIXME */
-  //GST_BUFFER_FLAG_SET (buf, GST_BUFFER_READONLY);
-  //GST_BUFFER_FLAG_SET (buf, GST_BUFFER_ORIGINAL);
   GST_BUFFER_SIZE (buf) = size;
   GST_BUFFER_OFFSET (buf) = offset;
   GST_BUFFER_OFFSET_END (buf) = offset + size;
index 6e177f1..6106f9b 100644 (file)
@@ -429,7 +429,12 @@ gst_mmap_buffer_class_init (gpointer g_class, gpointer class_data)
 static void
 gst_mmap_buffer_init (GTypeInstance * instance, gpointer g_class)
 {
+  GstBuffer *buf = (GstBuffer *) instance;
 
+  GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_READONLY);
+  /* before we re-enable this flag, we probably need to fix _copy()
+   * _make_writable(), etc. in GstMiniObject/GstBuffer as well */
+  /* GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_ORIGINAL); */
 }
 
 static void
@@ -500,9 +505,6 @@ gst_file_src_map_region (GstFileSrc * src, off_t offset, size_t size)
 #endif
 
   /* fill in the rest of the fields */
-  /* FIXME */
-  //GST_BUFFER_FLAG_SET (buf, GST_BUFFER_READONLY);
-  //GST_BUFFER_FLAG_SET (buf, GST_BUFFER_ORIGINAL);
   GST_BUFFER_SIZE (buf) = size;
   GST_BUFFER_OFFSET (buf) = offset;
   GST_BUFFER_OFFSET_END (buf) = offset + size;