Skip to content
This repository
Browse code

aml: fixed aml_present to actually work

  • Loading branch information...
commit 5aef1c54fda3d1f94b10f05df003e6134488f878 1 parent 6d2989c
authored September 12, 2013

Showing 1 changed file with 6 additions and 2 deletions. Show diff stats Hide diff stats

  1. 8  xbmc/utils/AMLUtils.cpp
8  xbmc/utils/AMLUtils.cpp
@@ -25,6 +25,7 @@
25 25
 #include <fcntl.h>
26 26
 #include <string>
27 27
 
  28
+#include "utils/log.h"
28 29
 #include "utils/StringUtils.h"
29 30
 
30 31
 int aml_set_sysfs_str(const char *path, const char *val)
@@ -70,7 +71,7 @@ int aml_set_sysfs_int(const char *path, const int val)
70 71
 
71 72
 int aml_get_sysfs_int(const char *path)
72 73
 {
73  
-  int val = 0;
  74
+  int val = -1;
74 75
   int fd = open(path, O_RDONLY);
75 76
   if (fd >= 0)
76 77
   {
@@ -87,10 +88,13 @@ bool aml_present()
87 88
   static int has_aml = -1;
88 89
   if (has_aml == -1)
89 90
   {
90  
-    if (aml_get_sysfs_int("/sys/class/audiodsp/digital_raw") != -1)
  91
+    int rtn = aml_get_sysfs_int("/sys/class/audiodsp/digital_raw");
  92
+    if (rtn != -1)
91 93
       has_aml = 1;
92 94
     else
93 95
       has_aml = 0;
  96
+    if (has_aml)
  97
+      CLog::Log(LOGNOTICE, "aml_present, rtn(%d)", rtn);
94 98
   }
95 99
   return has_aml;
96 100
 }

0 notes on commit 5aef1c5

Please sign in to comment.
Something went wrong with that request. Please try again.