[x265] [PATCH 3 of 4 RFC] cli: retrieve build strings from api pointer, rather than exported symbols

Steve Borho steve at borho.org
Sat Jun 6 19:42:39 CEST 2015


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1433611892 18000
#      Sat Jun 06 12:31:32 2015 -0500
# Node ID 4e4673bcf5ef25d7e4bcba35f911365ce4e0cb6a
# Parent  60a0f75943309dea951b913a713d9f1a77da79bd
cli: retrieve build strings from api pointer, rather than exported symbols

diff -r 60a0f7594330 -r 4e4673bcf5ef source/x265.cpp
--- a/source/x265.cpp	Sat Jun 06 12:30:27 2015 -0500
+++ b/source/x265.cpp	Sat Jun 06 12:31:32 2015 -0500
@@ -215,6 +215,7 @@
     if (bShowHelp)
     {
         api->param_default(param);
+        printVersion(param, api);
         showHelp(param);
     }
 
@@ -229,11 +230,12 @@
         {
         case 'h':
             api->param_default(param);
+            printVersion(param, api);
             showHelp(param);
             break;
 
         case 'V':
-            printVersion(param);
+            printVersion(param, api);
             x265_setup_primitives(param, -1);
             exit(0);
 
@@ -319,6 +321,7 @@
     if (argc <= 1)
     {
         api->param_default(param);
+        printVersion(param, api);
         showHelp(param);
     }
 
diff -r 60a0f7594330 -r 4e4673bcf5ef source/x265cli.h
--- a/source/x265cli.h	Sat Jun 06 12:30:27 2015 -0500
+++ b/source/x265cli.h	Sat Jun 06 12:31:32 2015 -0500
@@ -220,16 +220,15 @@
     { 0, 0, 0, 0 }
 };
 
-static void printVersion(x265_param *param)
+static void printVersion(x265_param *param, const x265_api* api)
 {
-    x265_log(param, X265_LOG_INFO, "HEVC encoder version %s\n", x265_version_str);
-    x265_log(param, X265_LOG_INFO, "build info %s\n", x265_build_info_str);
+    x265_log(param, X265_LOG_INFO, "HEVC encoder version %s\n", api->version_str);
+    x265_log(param, X265_LOG_INFO, "build info %s\n", api->build_info_str);
 }
 
 static void showHelp(x265_param *param)
 {
     int level = param->logLevel;
-    printVersion(param);
 
 #define OPT(value) (value ? "enabled" : "disabled")
 #define H0 printf


More information about the x265-devel mailing list