Add stream packet header accessors
[babeltrace.git] / formats / ctf / writer / writer.c
index a1605fcee198fd2561fb9d0ec1f4d5c7c9908a45..460ac81c9c4f158c46dc32e3ed1fb645a1553139 100644 (file)
@@ -215,6 +215,13 @@ struct bt_ctf_stream *bt_ctf_writer_create_stream(struct bt_ctf_writer *writer,
                goto error;
        }
 
+       ret = bt_ctf_stream_class_set_byte_order(stream_class,
+               writer->byte_order == LITTLE_ENDIAN ?
+               BT_CTF_BYTE_ORDER_LITTLE_ENDIAN : BT_CTF_BYTE_ORDER_BIG_ENDIAN);
+       if (ret) {
+               goto error;
+       }
+
        stream = bt_ctf_stream_create(stream_class);
        if (!stream) {
                goto error;
@@ -227,13 +234,6 @@ struct bt_ctf_stream *bt_ctf_writer_create_stream(struct bt_ctf_writer *writer,
 
        bt_ctf_stream_set_flush_callback(stream, (flush_func)stream_flush_cb,
                writer);
-       ret = bt_ctf_stream_class_set_byte_order(stream->stream_class,
-               writer->byte_order == LITTLE_ENDIAN ?
-               BT_CTF_BYTE_ORDER_LITTLE_ENDIAN : BT_CTF_BYTE_ORDER_BIG_ENDIAN);
-       if (ret) {
-               goto error;
-       }
-
 
        for (i = 0; i < writer->stream_classes->len; i++) {
                if (writer->stream_classes->pdata[i] == stream->stream_class) {
This page took 0.023314 seconds and 4 git commands to generate.