Disable buffering on stdout. 63/26963/1
authorAndriy Tryshnivskyy <andriy.tryshnivskyy@opensynergy.com>
Thu, 2 Dec 2021 11:07:58 +0000 (13:07 +0200)
committerAndriy Tryshnivskyy <andriy.tryshnivskyy@opensynergy.com>
Sat, 4 Dec 2021 09:40:42 +0000 (11:40 +0200)
It fix a problem when prints to sdtout are not visible in journalctl.

Bug-AGL: SPEC-4166
Change-Id: I5652e84bdfd3307edf53d2d7d07c532f41faa909
Signed-off-by: Andriy Tryshnivskyy <andriy.tryshnivskyy@opensynergy.com>
app/main.cpp

index 8634bbc..fff9c4c 100644 (file)
@@ -672,6 +672,8 @@ int main(int argc, char *argv[])
                DEFAULT_VIDEO_DEVICE, WINDOW_WIDTH_SIZE, WINDOW_HEIGHT_SIZE);
        gst_init(&gargc, &gargv);
 
+       setbuf(stdout, NULL);
+
        fprintf(stdout, "Using pipeline: %s\n", pipeline_str);
 
        GstElement *pipeline = gst_parse_launch(pipeline_str, &error);