[Libva] [Libva-intel-driver PATCH 1/6] Fix the parse issue that it can't recognize the hexadecimal of VA_INTEL_DEBUG
Zhao, Yakui
yakui.zhao at intel.com
Sun Aug 17 19:50:50 PDT 2014
From: Zhao Yakui <yakui.zhao at intel.com>
Currently when the hexicmal value is assigned to VA_INTEL_DEBUG env variable,
it can't be recognized.
Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
---
src/intel_driver.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/intel_driver.c b/src/intel_driver.c
index 994e64c..9e93efb 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -79,8 +79,15 @@ intel_driver_init(VADriverContextP ctx)
char *env_str = NULL;
g_intel_debug_option_flags = 0;
- if ((env_str = getenv("VA_INTEL_DEBUG")))
- g_intel_debug_option_flags = atoi(env_str);
+ if ((env_str = getenv("VA_INTEL_DEBUG"))) {
+ char *debug_ptr = NULL;
+ debug_ptr = strstr(env_str, "0x");
+ if (debug_ptr) {
+ g_intel_debug_option_flags = strtoul(debug_ptr, NULL, 16);
+ } else {
+ g_intel_debug_option_flags = atoi(env_str);
+ }
+ }
if (g_intel_debug_option_flags)
fprintf(stderr, "g_intel_debug_option_flags:%x\n", g_intel_debug_option_flags);
--
1.7.10.1
More information about the Libva
mailing list