diff options
author | Sean McNeil <sean.mcneil@windriver.com> | 2009-12-09 19:14:04 +0700 |
---|---|---|
committer | Sean McNeil <sean.mcneil@windriver.com> | 2009-12-09 19:14:04 +0700 |
commit | 9dbd394caab7b86caa8d010abf77448f3b718683 (patch) | |
tree | adc29cfe9f65b8eec49213859d6d500ef330fd33 | |
parent | 55c0a2979d070b56b3e10bd92a9fc9aa7b174246 (diff) | |
download | alsa_sound-9dbd394caab7b86caa8d010abf77448f3b718683.tar.gz |
Revert to named devices of AndroidPlayback/AndroidCapture for backwards compatability. Use appropriate devicePrefix - Michael Trimarchi
-rw-r--r-- | alsa_default.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/alsa_default.cpp b/alsa_default.cpp index 0e8e71e..1951498 100644 --- a/alsa_default.cpp +++ b/alsa_default.cpp @@ -93,8 +93,8 @@ static int s_device_close(hw_device_t* device) static const int DEFAULT_SAMPLE_RATE = ALSA_DEFAULT_SAMPLE_RATE; static const char *devicePrefix[SND_PCM_STREAM_LAST + 1] = { - /* SND_PCM_STREAM_PLAYBACK : */"AndroidOut", - /* SND_PCM_STREAM_CAPTURE : */"AndroidIn", + /* SND_PCM_STREAM_PLAYBACK : */"AndroidPlayback", + /* SND_PCM_STREAM_CAPTURE : */"AndroidCapture", }; static alsa_handle_t _defaultsOut = { @@ -146,12 +146,18 @@ static const int deviceSuffixLen = (sizeof(deviceSuffix) // ---------------------------------------------------------------------------- +snd_pcm_stream_t direction(alsa_handle_t *handle) +{ + return (handle->devices & AudioSystem::DEVICE_OUT_ALL) ? SND_PCM_STREAM_PLAYBACK + : SND_PCM_STREAM_CAPTURE; +} + const char *deviceName(alsa_handle_t *handle, uint32_t device, int mode) { static char devString[ALSA_NAME_MAX]; int hasDevExt = 0; - strcpy(devString, devicePrefix[0]); + strcpy(devString, devicePrefix[direction(handle)]); for (int dev = 0; device && dev < deviceSuffixLen; dev++) if (device & deviceSuffix[dev].device) { @@ -178,12 +184,6 @@ const char *deviceName(alsa_handle_t *handle, uint32_t device, int mode) return devString; } -snd_pcm_stream_t direction(alsa_handle_t *handle) -{ - return (handle->devices & AudioSystem::DEVICE_OUT_ALL) ? SND_PCM_STREAM_PLAYBACK - : SND_PCM_STREAM_CAPTURE; -} - const char *streamName(alsa_handle_t *handle) { return snd_pcm_stream_name(direction(handle)); |