[x265] [PATCH] replace comma with dot seperator from commandline when dumping to csv

mahesh at multicorewareinc.com mahesh at multicorewareinc.com
Thu Oct 15 12:21:38 CEST 2015


# HG changeset patch
# User Mahesh Pittala <mahesh at multicorewareinc.com>
# Date 1444904078 -19800
#      Thu Oct 15 15:44:38 2015 +0530
# Node ID 6e001b1e7bef6835b61d972977565d069690f65d
# Parent  b6156a08b1def3584647f26096866c1a0c11e54a
replace comma with dot seperator from commandline when dumping to csv

When we add comma in commandline, commandline splitting into multiple cells in csv
so the header and data are mismatching

diff -r b6156a08b1de -r 6e001b1e7bef source/common/threadpool.cpp
--- a/source/common/threadpool.cpp	Fri Oct 09 20:45:59 2015 +0530
+++ b/source/common/threadpool.cpp	Thu Oct 15 15:44:38 2015 +0530
@@ -298,10 +298,10 @@
                 nodeMaskPerPool[i] = ((uint64_t)1 << i);
             }
 
-            /* consume current node string, comma, and white-space */
-            while (*nodeStr && *nodeStr != ',')
+            /* consume current node string, comma, period, and white-space */
+            while (*nodeStr && *nodeStr != ',' && *nodeStr != '.')
                ++nodeStr;
-            if (*nodeStr == ',' || *nodeStr == ' ')
+            if (*nodeStr == ',' || *nodeStr == '.' || *nodeStr == ' ')
                ++nodeStr;
         }
     }
diff -r b6156a08b1de -r 6e001b1e7bef source/x265-extras.cpp
--- a/source/x265-extras.cpp	Fri Oct 09 20:45:59 2015 +0530
+++ b/source/x265-extras.cpp	Thu Oct 15 15:44:38 2015 +0530
@@ -201,7 +201,11 @@
     for (int i = 1; i < argc; i++)
     {
         if (i) fputc(' ', csvfp);
-        fputs(argv[i], csvfp);
+        for (int j = 0; j < strlen(argv[i]); j++)
+            if (argv[i][j] == ',')
+                fputc ('.', csvfp);
+            else
+                fputc (argv[i][j], csvfp);
     }
 
     // current date and time


More information about the x265-devel mailing list