mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 19:20:35 +00:00
event: fix event copy
Fix parent refcount on event copy. Fix unit test.
This commit is contained in:
parent
fa6bcde7e3
commit
b1676b8c30
2 changed files with 4 additions and 3 deletions
|
@ -241,7 +241,8 @@ _gst_event_copy (GstEvent * event)
|
|||
s = GST_EVENT_STRUCTURE (event);
|
||||
if (s) {
|
||||
GST_EVENT_STRUCTURE (copy) = gst_structure_copy (s);
|
||||
gst_structure_set_parent_refcount (s, ©->event.mini_object.refcount);
|
||||
gst_structure_set_parent_refcount (GST_EVENT_STRUCTURE (copy),
|
||||
©->event.mini_object.refcount);
|
||||
}
|
||||
return GST_EVENT_CAST (copy);
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ GST_START_TEST (create_events)
|
|||
fail_unless (ctd1 == ctd2);
|
||||
fail_unless (ct1 == ct2);
|
||||
gst_event_parse_qos (event, &t2, &p2, &ctd2, &ct2);
|
||||
fail_unless (t2 == GST_QOS_TYPE_UNDERFLOW);
|
||||
fail_unless (t2 == GST_QOS_TYPE_THROTTLE);
|
||||
fail_unless (p1 == p2);
|
||||
fail_unless (ctd1 == ctd2);
|
||||
fail_unless (ct1 == ct2);
|
||||
|
@ -132,7 +132,7 @@ GST_START_TEST (create_events)
|
|||
ctd1 = G_GINT64_CONSTANT (-10);
|
||||
event = gst_event_new_qos (t1, p1, ctd1, ct1);
|
||||
gst_event_parse_qos (event, &t2, &p2, &ctd2, &ct2);
|
||||
fail_unless (t2 == GST_QOS_TYPE_OVERFLOW);
|
||||
fail_unless (t2 == GST_QOS_TYPE_THROTTLE);
|
||||
gst_event_unref (event);
|
||||
|
||||
event = gst_event_new_qos (t1, p1, ctd1, ct1);
|
||||
|
|
Loading…
Reference in a new issue