Commit b1676b8c authored by Wim Taymans's avatar Wim Taymans

event: fix event copy

Fix parent refcount on event copy.
Fix unit test.
parent fa6bcde7
......@@ -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, &copy->event.mini_object.refcount);
gst_structure_set_parent_refcount (GST_EVENT_STRUCTURE (copy),
&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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment