diff options
author | Sean McNeil <sean.mcneil@windriver.com> | 2009-08-12 05:59:27 +0700 |
---|---|---|
committer | Sean McNeil <sean.mcneil@windriver.com> | 2009-08-12 05:59:27 +0700 |
commit | 4faf1b0935498ef83ef0eb141f0bae2b631ca94e (patch) | |
tree | 8f7adf14cf0f9b86a6c1977573417b94a461ec77 | |
parent | 67c914a7a68d321a0aabb7ea087e97c5c44f2338 (diff) | |
download | alsa_sound-4faf1b0935498ef83ef0eb141f0bae2b631ca94e.tar.gz |
Add new argument to openInputStream introduced in Donut.
-rw-r--r-- | AudioHardwareALSA.cpp | 9 | ||||
-rw-r--r-- | AudioHardwareALSA.h | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/AudioHardwareALSA.cpp b/AudioHardwareALSA.cpp index d511a5f..d9b67ef 100644 --- a/AudioHardwareALSA.cpp +++ b/AudioHardwareALSA.cpp @@ -284,7 +284,8 @@ AudioHardwareALSA::openOutputStream(int format, } AudioStreamIn * -AudioHardwareALSA::openInputStream(int format, +AudioHardwareALSA::openInputStream(int inputSource, + int format, int channelCount, uint32_t sampleRate, status_t *status, @@ -292,6 +293,12 @@ AudioHardwareALSA::openInputStream(int format, { AutoMutex lock(mLock); + // check for valid input source + if ((inputSource < AudioRecord::DEFAULT_INPUT) || + (inputSource >= AudioRecord::NUM_INPUT_SOURCES)) { + return 0; + } + // only one input stream allowed if (mInput) { *status = ALREADY_EXISTS; diff --git a/AudioHardwareALSA.h b/AudioHardwareALSA.h index 189b086..83fdab3 100644 --- a/AudioHardwareALSA.h +++ b/AudioHardwareALSA.h @@ -273,6 +273,7 @@ namespace android /** This method creates and opens the audio hardware input stream */ virtual AudioStreamIn* openInputStream( + int inputSource, int format, int channelCount, uint32_t sampleRate, |