validate: flow: Fix for line-ending mismatch issue on Windows
authorSeungha Yang <seungha@centricular.com>
Thu, 7 Oct 2021 10:28:41 +0000 (19:28 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 13 Oct 2021 16:21:52 +0000 (16:21 +0000)
Unlike POSIX system, Windows distinguishes "w" and "wb" and when
a file is opened with text mode, OS will translate \n into \r\n.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1092>

subprojects/gst-devtools/validate/gst/validate/flow/gstvalidateflow.c

index 0662a31..873480a 100644 (file)
@@ -423,7 +423,7 @@ validate_flow_setup_files (ValidateFlowOverride * flow, gint default_generate)
     g_free (directory_path);
   }
 
-  flow->output_file = fopen (flow->output_file_path, "w");
+  flow->output_file = fopen (flow->output_file_path, "wb");
   if (!flow->output_file)
     gst_validate_abort ("Could not open for writing: %s",
         flow->output_file_path);