diff options
author | davilla <davilla@4pi.com> | 2013-09-12 10:03:47 -0400 |
---|---|---|
committer | S. Davilla <davilla@4pi.com> | 2013-09-22 20:31:18 -0400 |
commit | 5aef1c54fda3d1f94b10f05df003e6134488f878 (patch) | |
tree | 1682d995b6e3c91331f8013099ab1f5c60890e29 | |
parent | 6d2989ceba881d9a44b32c0cbfa82a9dfa3316de (diff) |
aml: fixed aml_present to actually work
-rw-r--r-- | xbmc/utils/AMLUtils.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xbmc/utils/AMLUtils.cpp b/xbmc/utils/AMLUtils.cpp index d9b9e06887..6a3100d23f 100644 --- a/xbmc/utils/AMLUtils.cpp +++ b/xbmc/utils/AMLUtils.cpp @@ -25,6 +25,7 @@ #include <fcntl.h> #include <string> +#include "utils/log.h" #include "utils/StringUtils.h" 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) int aml_get_sysfs_int(const char *path) { - int val = 0; + int val = -1; int fd = open(path, O_RDONLY); if (fd >= 0) { @@ -87,10 +88,13 @@ bool aml_present() static int has_aml = -1; if (has_aml == -1) { - if (aml_get_sysfs_int("/sys/class/audiodsp/digital_raw") != -1) + int rtn = aml_get_sysfs_int("/sys/class/audiodsp/digital_raw"); + if (rtn != -1) has_aml = 1; else has_aml = 0; + if (has_aml) + CLog::Log(LOGNOTICE, "aml_present, rtn(%d)", rtn); } return has_aml; } |