plugins/elements/gstqueue.c: Ensure that buffer metadata is writeable, before modifying. Spotted by

Original commit message from CVS:
* plugins/elements/gstqueue.c:
Ensure that buffer metadata is writeable, before modifying. Spotted by
Mike.
This commit is contained in:
Stefan Kost 2008-02-21 10:22:36 +00:00
parent 0b9cfcfbcd
commit 10a0bd0e5a
2 changed files with 22 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2008-02-21 Stefan Kost <ensonic@users.sf.net>
* plugins/elements/gstqueue.c:
Ensure that buffer metadata is writeable, before modifying. Spotted by
Mike.
2008-02-20 Stefan Kost <ensonic@users.sf.net>
* plugins/elements/gstqueue.c:

View file

@ -919,7 +919,14 @@ gst_queue_chain (GstPad * pad, GstBuffer * buffer)
}
if (queue->tail_needs_discont) {
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT);
GstBuffer *subbuffer = gst_buffer_make_metadata_writable (buffer);
if (subbuffer) {
buffer = subbuffer;
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT);
} else {
GST_DEBUG_OBJECT (queue, "Could not mark buffer as DISCONT");
}
queue->tail_needs_discont = FALSE;
}
@ -991,7 +998,14 @@ next:
caps = GST_BUFFER_CAPS (buffer);
if (queue->head_needs_discont) {
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT);
GstBuffer *subbuffer = gst_buffer_make_metadata_writable (buffer);
if (subbuffer) {
buffer = subbuffer;
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DISCONT);
} else {
GST_DEBUG_OBJECT (queue, "Could not mark buffer as DISCONT");
}
queue->head_needs_discont = FALSE;
}