diff options
| author | 2008-12-19 08:31:54 -0800 | |
|---|---|---|
| committer | 2008-12-19 08:31:54 -0800 | |
| commit | 772a89695f179b51d16b26c1b0d946aa3e850e70 (patch) | |
| tree | 9a9fdadd1301625f875a3c126c986c79e3363ac4 /libs/audioflinger/AudioHardwareStub.cpp | |
| parent | d34e59679f6a98e9e67ef4bd18da6e5a86d386bc (diff) | |
| parent | e09fd9e819c23dc90bca68375645e15544861330 (diff) | |
Merge commit 'remotes/korg/cupcake'
Conflicts:
	core/java/com/android/internal/app/AlertController.java
	core/res/res/values/strings.xml
	media/java/android/media/AudioSystem.java
	services/java/com/android/server/LocationManagerService.java
Diffstat (limited to 'libs/audioflinger/AudioHardwareStub.cpp')
| -rw-r--r-- | libs/audioflinger/AudioHardwareStub.cpp | 36 | 
1 files changed, 22 insertions, 14 deletions
| diff --git a/libs/audioflinger/AudioHardwareStub.cpp b/libs/audioflinger/AudioHardwareStub.cpp index 0046db8531..d309902a0d 100644 --- a/libs/audioflinger/AudioHardwareStub.cpp +++ b/libs/audioflinger/AudioHardwareStub.cpp @@ -2,16 +2,16 @@  **  ** Copyright 2007, The Android Open Source Project  ** -** Licensed under the Apache License, Version 2.0 (the "License");  -** you may not use this file except in compliance with the License.  -** You may obtain a copy of the License at  +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at  ** -**     http://www.apache.org/licenses/LICENSE-2.0  +**     http://www.apache.org/licenses/LICENSE-2.0  ** -** Unless required by applicable law or agreed to in writing, software  -** distributed under the License is distributed on an "AS IS" BASIS,  -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  -** See the License for the specific language governing permissions and  +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and  ** limitations under the License.  */ @@ -47,20 +47,28 @@ status_t AudioHardwareStub::standby()  }  AudioStreamOut* AudioHardwareStub::openOutputStream( -        int format, int channelCount, uint32_t sampleRate) +        int format, int channelCount, uint32_t sampleRate, status_t *status)  {      AudioStreamOutStub* out = new AudioStreamOutStub(); -    if (out->set(format, channelCount, sampleRate) == NO_ERROR) +    status_t lStatus = out->set(format, channelCount, sampleRate); +    if (status) { +        *status = lStatus; +    } +    if (lStatus == NO_ERROR)          return out;      delete out;      return 0;  }  AudioStreamIn* AudioHardwareStub::openInputStream( -        int format, int channelCount, uint32_t sampleRate) +        int format, int channelCount, uint32_t sampleRate, status_t *status)  {      AudioStreamInStub* in = new AudioStreamInStub(); -    if (in->set(format, channelCount, sampleRate) == NO_ERROR) +    status_t lStatus = in->set(format, channelCount, sampleRate); +    if (status) { +        *status = lStatus; +    } +    if (lStatus == NO_ERROR)          return in;      delete in;      return 0; @@ -102,7 +110,7 @@ status_t AudioStreamOutStub::set(int format, int channels, uint32_t rate)      if (format == 0) format = AudioSystem::PCM_16_BIT;      if (channels == 0) channels = channelCount();      if (rate == 0) rate = sampleRate(); -     +      if ((format == AudioSystem::PCM_16_BIT) &&              (channels == channelCount()) &&              (rate == sampleRate())) @@ -129,7 +137,7 @@ status_t AudioStreamOutStub::dump(int fd, const Vector<String16>& args)      snprintf(buffer, SIZE, "\tformat: %d\n", format());      result.append(buffer);      ::write(fd, result.string(), result.size()); -    return NO_ERROR;  +    return NO_ERROR;  }  // ---------------------------------------------------------------------------- |