stream->id = stream_class->next_stream_id++;
stream->stream_class = stream_class;
bt_ctf_stream_class_get(stream_class);
- bt_ctf_stream_class_freeze(stream_class);
stream->events = g_ptr_array_new_with_free_func(
(GDestroyNotify) bt_ctf_event_put);
if (!stream->events) {
goto end;
}
- if (stream->flushed_packet_count) {
- /* ctf_init_pos has already initialized the first packet */
- ctf_packet_seek(&stream->pos.parent, 0, SEEK_CUR);
- }
+ /* mmap the next packet */
+ ctf_packet_seek(&stream->pos.parent, 0, SEEK_CUR);
ret = bt_ctf_field_serialize(stream->packet_header, &stream->pos);
if (ret) {