This ensures that a stream class' id is set before we create a stream
instance and initialize its packet header. Otherwise, the packet header
stream_id is initialized to its default value (0).
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
goto error;
}
- stream = bt_ctf_stream_create(stream_class, trace);
- if (!stream) {
- goto error;
- }
-
for (i = 0; i < trace->stream_classes->len; i++) {
if (trace->stream_classes->pdata[i] == stream_class) {
stream_class_found = 1;
}
}
+ stream = bt_ctf_stream_create(stream_class, trace);
+ if (!stream) {
+ goto error;
+ }
+
bt_ctf_stream_get(stream);
g_ptr_array_add(trace->streams, stream);