From: David Schleef Date: Sun, 11 Jan 2004 22:37:03 +0000 (+0000) Subject: Inherit some of parent's buffer flags. X-Git-Tag: BRANCH-RELEASE-0_7_4-ROOT~169 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1e5984afaef476b110fabe5aa0e47e4cd86e422;p=platform%2Fupstream%2Fgstreamer.git Inherit some of parent's buffer flags. Original commit message from CVS: Inherit some of parent's buffer flags. --- diff --git a/ChangeLog b/ChangeLog index acdfc8c..134a8fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2004-01-11 David Schleef + * gst/gstbuffer.c: (gst_buffer_create_sub): Subbuffers should + inherit correct flags (READONLY and DONTKEEP). + +2004-01-11 David Schleef + * gst/elements/gstfilesrc.c: (gst_filesrc_free_parent_mmap), (gst_filesrc_map_region): * gst/gstbuffer.c: (_gst_buffer_initialize), diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c index 2c9e43e..83a95e6 100644 --- a/gst/gstbuffer.c +++ b/gst/gstbuffer.c @@ -295,9 +295,13 @@ gst_buffer_create_sub (GstBuffer *parent, guint offset, guint size) GST_BUFFER_DURATION (buffer) = GST_CLOCK_TIME_NONE; GST_BUFFER_OFFSET_END (buffer) = GST_BUFFER_OFFSET_NONE; - /* make sure nobody overwrites data as it would overwrite in the parent. - * data in parent cannot be overwritten because we hold a ref */ - GST_DATA_FLAG_SET (parent, GST_DATA_READONLY); + + if (GST_BUFFER_FLAG_IS_SET (parent, GST_BUFFER_DONTKEEP)) { + GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_DONTKEEP); + } + if (GST_BUFFER_FLAG_IS_SET (parent, GST_BUFFER_READONLY)) { + GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_READONLY); + } return buffer; }