event: Require writable events for setting the running-time-offset and sequence number

Otherwise multiple code paths with the same event could change the
values on each other.

https://bugzilla.gnome.org/show_bug.cgi?id=796615
This commit is contained in:
Sebastian Dröge 2018-06-18 09:17:36 +03:00
parent 6dba0d91ed
commit 1908daf29c

View file

@ -449,6 +449,7 @@ gst_event_set_seqnum (GstEvent * event, guint32 seqnum)
{ {
g_return_if_fail (GST_IS_EVENT (event)); g_return_if_fail (GST_IS_EVENT (event));
g_return_if_fail (seqnum != GST_SEQNUM_INVALID); g_return_if_fail (seqnum != GST_SEQNUM_INVALID);
g_return_if_fail (gst_event_is_writable (event));
GST_EVENT_SEQNUM (event) = seqnum; GST_EVENT_SEQNUM (event) = seqnum;
} }
@ -497,6 +498,7 @@ void
gst_event_set_running_time_offset (GstEvent * event, gint64 offset) gst_event_set_running_time_offset (GstEvent * event, gint64 offset)
{ {
g_return_if_fail (GST_IS_EVENT (event)); g_return_if_fail (GST_IS_EVENT (event));
g_return_if_fail (gst_event_is_writable (event));
((GstEventImpl *) event)->running_time_offset = offset; ((GstEventImpl *) event)->running_time_offset = offset;
} }