event: fix event copy

Fix parent refcount on event copy.
Fix unit test.
This commit is contained in:
Wim Taymans 2011-05-18 15:43:20 +02:00
parent fa6bcde7e3
commit b1676b8c30
2 changed files with 4 additions and 3 deletions

View file

@ -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);
}

View file

@ -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);