From: Stefan Kost Date: Fri, 15 Feb 2008 12:33:00 +0000 (+0000) Subject: gst/gstbuffer.c: Copy selected buffer-flags when creating subbuffers. X-Git-Tag: RELEASE-0_10_18~47 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f09aa1dd08b61a6496ed9ab61583c5a51da57350;p=platform%2Fupstream%2Fgstreamer.git gst/gstbuffer.c: Copy selected buffer-flags when creating subbuffers. Original commit message from CVS: * gst/gstbuffer.c: Copy selected buffer-flags when creating subbuffers. Fixes #516395. --- diff --git a/ChangeLog b/ChangeLog index abef797..6ef489d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-15 Stefan Kost + + * gst/gstbuffer.c: + Copy selected buffer-flags when creating subbuffers. + Fixes #516395. + 2008-02-12 Sebastian Dröge * gst/gstbuffer.c: (gst_buffer_class_init), (gst_buffer_finalize): diff --git a/common b/common index 05a617c..2a19465 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 05a617c9043ddb78f8578195b18c166d7e1d4c2e +Subproject commit 2a19465fdb43a75f4d32950fd2beb1beb950eec2 diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c index 7d7eca0..e28c11d 100644 --- a/gst/gstbuffer.c +++ b/gst/gstbuffer.c @@ -464,12 +464,6 @@ gst_buffer_make_metadata_writable (GstBuffer * buf) } else { ret = gst_buffer_create_sub (buf, 0, GST_BUFFER_SIZE (buf)); - /* copy all the flags except IN_CAPS */ - GST_BUFFER_FLAGS (ret) = GST_BUFFER_FLAGS (buf); - GST_BUFFER_FLAG_UNSET (ret, GST_BUFFER_FLAG_IN_CAPS); - /* data should always be set to READONLY */ - GST_BUFFER_FLAG_SET (ret, GST_BUFFER_FLAG_READONLY); - gst_buffer_unref (buf); } @@ -599,6 +593,16 @@ gst_buffer_create_sub (GstBuffer * buffer, guint offset, guint size) GST_BUFFER_DATA (GST_BUFFER_CAST (subbuffer)) = buffer->data + offset; GST_BUFFER_SIZE (GST_BUFFER_CAST (subbuffer)) = size; + if ((offset == 0) && (size == GST_BUFFER_SIZE (buffer))) { + /* copy all the flags except IN_CAPS */ + GST_BUFFER_FLAG_SET (subbuffer, GST_BUFFER_FLAGS (buffer)); + GST_BUFFER_FLAG_UNSET (subbuffer, GST_BUFFER_FLAG_IN_CAPS); + } else { + /* copy only PREROLL & GAP flags */ + GST_BUFFER_FLAG_SET (subbuffer, (GST_BUFFER_FLAGS (buffer) & + (GST_BUFFER_FLAG_PREROLL | GST_BUFFER_FLAG_GAP))); + } + /* we can copy the timestamp and offset if the new buffer starts at * offset 0 */ if (offset == 0) {