for (i = 0; i < trace->stream_classes->len; i++) {
if (trace->stream_classes->pdata[i] == stream_class) {
+ /* Stream already registered to the trace */
ret = -1;
goto end;
}
}
}
- if (_bt_ctf_stream_class_set_id(stream_class,
+ if (bt_ctf_stream_class_set_id_no_check(stream_class,
stream_id)) {
/* TODO Should retry with a different stream id */
ret = -1;
}
bt_ctf_stream_class_freeze(stream_class);
- bt_ctf_trace_freeze(trace);
+ if (!trace->frozen) {
+ bt_ctf_trace_freeze(trace);
+ }
end:
if (ret) {
(void) bt_ctf_stream_class_set_trace(stream_class, NULL);