diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-07-20 09:17:36 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-07-20 09:17:36 -0600 |
commit | ccfc48d9dc0aeb02ff84ff2619afb341fde57ad1 (patch) | |
tree | 0298795ce3fd8e98fe29b706fe83b03344b8d7b9 /apps/system/nxplayer | |
parent | 2f98b0a7d162f67a3f33dd0bdaf0529233a25889 (diff) | |
download | px4-nuttx-ccfc48d9dc0aeb02ff84ff2619afb341fde57ad1.tar.gz px4-nuttx-ccfc48d9dc0aeb02ff84ff2619afb341fde57ad1.tar.bz2 px4-nuttx-ccfc48d9dc0aeb02ff84ff2619afb341fde57ad1.zip |
WM8904 w/NxPlayer: Fix some compile errors and warnings with debug enabled
Diffstat (limited to 'apps/system/nxplayer')
-rw-r--r-- | apps/system/nxplayer/nxplayer.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/apps/system/nxplayer/nxplayer.c b/apps/system/nxplayer/nxplayer.c index 147871f6f..ec52f8a3b 100644 --- a/apps/system/nxplayer/nxplayer.c +++ b/apps/system/nxplayer/nxplayer.c @@ -152,13 +152,6 @@ static const int g_known_ext_count = sizeof(g_known_ext) / static int nxplayer_opendevice(FAR struct nxplayer_s *pPlayer, int format, int subfmt) { - struct dirent* pDevice; - DIR* dirp; - char path[64]; - struct audio_caps_s caps; - uint8_t supported = TRUE; - uint8_t x; - /* If we have a preferred device, then open it */ #ifdef CONFIG_NXPLAYER_INCLUDE_PREFERRED_DEVICE @@ -168,8 +161,8 @@ static int nxplayer_opendevice(FAR struct nxplayer_s *pPlayer, int format, * format is specified by the device */ - if (((pPlayer->prefformat & (1 << (format - 1)) == 0) || - ((pPlayer->preftype & AUDIO_TYPE_OUTPUT) == 0))) + if ((pPlayer->prefformat & (1 << (format - 1))) == 0 || + (pPlayer->preftype & AUDIO_TYPE_OUTPUT) == 0) { /* Format not supported by the device */ @@ -195,6 +188,13 @@ static int nxplayer_opendevice(FAR struct nxplayer_s *pPlayer, int format, #ifdef CONFIG_NXPLAYER_INCLUDE_DEVICE_SEARCH { + struct audio_caps_s caps; + FAR struct dirent *pDevice; + FAR DIR *dirp; + char path[64]; + uint8_t supported = TRUE; + uint8_t x; + /* Search for a device in the audio device directory */ #ifdef CONFIG_AUDIO_CUSTOM_DEV_PATH @@ -257,6 +257,7 @@ static int nxplayer_opendevice(FAR struct nxplayer_s *pPlayer, int format, (unsigned long) &caps) == caps.ac_len) { /* Check the next set of 4 controls to find the subformat */ + for (x = 0; x < sizeof(caps.ac_controls); x++) { if (caps.ac_controls[x] == subfmt) |