From 09f803fd76690edb60e9148811d66a2126bc33c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 31 Aug 2005 12:55:54 +0000 Subject: [PATCH] gst/elements/gstfilesrc.c: Set READONLY flag on mmap'ed buffers, otherwise gst_buffer_make_writable() won't work prop... 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 | 7 +++++++ gst/elements/gstfilesrc.c | 8 +++++--- plugins/elements/gstfilesrc.c | 8 +++++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 31042a1..a890cb6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-08-31 Tim-Philipp Müller + + * 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 * gst/base/gstbasetransform.c: (gst_base_transform_handle_buffer): diff --git a/gst/elements/gstfilesrc.c b/gst/elements/gstfilesrc.c index 6e177f1..6106f9b 100644 --- a/gst/elements/gstfilesrc.c +++ b/gst/elements/gstfilesrc.c @@ -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; diff --git a/plugins/elements/gstfilesrc.c b/plugins/elements/gstfilesrc.c index 6e177f1..6106f9b 100644 --- a/plugins/elements/gstfilesrc.c +++ b/plugins/elements/gstfilesrc.c @@ -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; -- 2.7.4