[x265] CLI: allow Unicode filenames (Windows) for '--qpfile' and '--csv'

Mateusz mateuszb at poczta.onet.pl
Sun May 15 01:48:29 CEST 2016


-------------- next part --------------
# HG changeset patch
# User Ma0 <mateuszb at poczta.onet.pl>
# Date 1463269269 -7200
#      Sun May 15 01:41:09 2016 +0200
# Node ID 882a67a80f470dc662f04ee3bfd13f1375a3d02e
# Parent  e5b5bdc3c154f908706fb75e006f9abf9b3de96f
CLI: allow Unicode filenames (Windows) for '--qpfile' and '--csv'

diff -r e5b5bdc3c154 -r 882a67a80f47 source/x265-extras.cpp
--- a/source/x265-extras.cpp	Sat May 14 07:29:46 2016 +0530
+++ b/source/x265-extras.cpp	Sun May 15 01:41:09 2016 +0200
@@ -46,17 +46,17 @@
         return NULL;
     }
 
-    FILE *csvfp = fopen(fname, "r");
+    FILE *csvfp = x265_fopen(fname, "r");
     if (csvfp)
     {
         /* file already exists, re-open for append */
         fclose(csvfp);
-        return fopen(fname, "ab");
+        return x265_fopen(fname, "ab");
     }
     else
     {
         /* new CSV file, write header */
-        csvfp = fopen(fname, "wb");
+        csvfp = x265_fopen(fname, "wb");
         if (csvfp)
         {
             if (level)
diff -r e5b5bdc3c154 -r 882a67a80f47 source/x265.cpp
--- a/source/x265.cpp	Sat May 14 07:29:46 2016 +0530
+++ b/source/x265.cpp	Sun May 15 01:41:09 2016 +0200
@@ -308,12 +308,9 @@
             OPT("recon-y4m-exec") reconPlayCmd = optarg;
             OPT("qpfile")
             {
-                this->qpfile = fopen(optarg, "rb");
+                this->qpfile = x265_fopen(optarg, "rb");
                 if (!this->qpfile)
-                {
-                    x265_log(param, X265_LOG_ERROR, "%s qpfile not found or error in opening qp file\n", optarg);
-                    return false;
-                }
+                    x265_log_file(param, X265_LOG_ERROR, "%s qpfile not found or error in opening qp file\n", optarg);
             }
             else
                 bError |= !!api->param_parse(param, long_options[long_options_index].name, optarg);
@@ -374,7 +371,7 @@
     this->input = InputFile::open(info, this->bForceY4m);
     if (!this->input || this->input->isFail())
     {
-        x265_log(param, X265_LOG_ERROR, "unable to open input file <%s>\n", inputfn);
+        x265_log_file(param, X265_LOG_ERROR, "unable to open input file <%s>\n", inputfn);
         return true;
     }
 
@@ -593,7 +590,7 @@
         cliopt.csvfpt = x265_csvlog_open(*api, *param, cliopt.csvfn, cliopt.csvLogLevel);
         if (!cliopt.csvfpt)
         {
-            x265_log(param, X265_LOG_ERROR, "Unable to open CSV log file <%s>, aborting\n", cliopt.csvfn);
+            x265_log_file(param, X265_LOG_ERROR, "Unable to open CSV log file <%s>, aborting\n", cliopt.csvfn);
             cliopt.destroy();
             if (cliopt.api)
                 cliopt.api->param_free(cliopt.param);


More information about the x265-devel mailing list