+ /*
+ * This event is an orphan for the moment: it's not
+ * associated to a stream. If this event's event
+ * class's stream class is the same as the packet's
+ * stream's stream class, then it's okay to make the
+ * packet's stream the parent of this event. Otherwise
+ * it's an error.
+ */
+ event_stream_class =
+ bt_ctf_event_class_get_stream_class(event->event_class);
+ packet_stream_class =
+ bt_ctf_stream_get_class(packet->stream);
+
+ assert(event_stream_class);
+ assert(packet_stream_class);
+
+ if (event_stream_class != packet_stream_class) {
+ ret = -1;
+ goto end;
+ }
+