mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
basesrc: Make sure the buffer metadata is writable before changing it
This commit is contained in:
parent
0cb5660c3e
commit
27bebf7456
1 changed files with 6 additions and 2 deletions
|
@ -2143,12 +2143,16 @@ again:
|
||||||
|
|
||||||
/* no timestamp set and we are at offset 0, we can timestamp with 0 */
|
/* no timestamp set and we are at offset 0, we can timestamp with 0 */
|
||||||
if (offset == 0 && src->segment.time == 0
|
if (offset == 0 && src->segment.time == 0
|
||||||
&& GST_BUFFER_TIMESTAMP (*buf) == -1)
|
&& GST_BUFFER_TIMESTAMP (*buf) == -1) {
|
||||||
|
*buf = gst_buffer_make_metadata_writable (*buf);
|
||||||
GST_BUFFER_TIMESTAMP (*buf) = 0;
|
GST_BUFFER_TIMESTAMP (*buf) = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* set pad caps on the buffer if the buffer had no caps */
|
/* set pad caps on the buffer if the buffer had no caps */
|
||||||
if (GST_BUFFER_CAPS (*buf) == NULL)
|
if (GST_BUFFER_CAPS (*buf) == NULL) {
|
||||||
|
*buf = gst_buffer_make_metadata_writable (*buf);
|
||||||
gst_buffer_set_caps (*buf, GST_PAD_CAPS (src->srcpad));
|
gst_buffer_set_caps (*buf, GST_PAD_CAPS (src->srcpad));
|
||||||
|
}
|
||||||
|
|
||||||
/* now sync before pushing the buffer */
|
/* now sync before pushing the buffer */
|
||||||
status = gst_base_src_do_sync (src, *buf);
|
status = gst_base_src_do_sync (src, *buf);
|
||||||
|
|
Loading…
Reference in a new issue