Skip to content

Commit

Permalink
aml: fixed aml_present to actually work
Browse files Browse the repository at this point in the history
  • Loading branch information
davilla committed Sep 23, 2013
1 parent 6d2989c commit 5aef1c5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions xbmc/utils/AMLUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
{
Expand All @@ -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;
}
Expand Down

0 comments on commit 5aef1c5

Please sign in to comment.