summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-04-30 16:54:30 -0700
committerGlenn Kasten <gkasten@google.com>2014-05-02 11:52:56 -0700
commitc4b88a8d0f524666bf0f390075c334d047a104f2 (patch)
treea2d45172a9d794b8b626ed9acadb656e346b2e9c /services/audioflinger
parentb53fc4ef8da47df8d5f580e8ee6135866ffebc33 (diff)
downloadframeworks_av-c4b88a8d0f524666bf0f390075c334d047a104f2.zip
frameworks_av-c4b88a8d0f524666bf0f390075c334d047a104f2.tar.gz
frameworks_av-c4b88a8d0f524666bf0f390075c334d047a104f2.tar.bz2
Fix bug for direct track with PCM != 16-bit
The AUDIO_FORMAT_PCM_8_BIT format was being converted to AUDIO_FORMAT_PCM_16_BIT on client side even for direct tracks. That conversion was incorrect; it should only be done for mixed tracks. Also remove checks for specific PCM formats in the generic part of server side of createTrack. Those format checks should only be done by the thread. This will allow direct tracks for PCM 8-bit, PCM 24-bit, etc. Change-Id: If5b9fd79f8642ed93e2aeabcaf4809b2ed798978
Diffstat (limited to 'services/audioflinger')
-rw-r--r--services/audioflinger/AudioFlinger.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 755d480..eb00c82 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -541,10 +541,8 @@ sp<IAudioTrack> AudioFlinger::createTrack(
goto Exit;
}
- // client is responsible for conversion of 8-bit PCM to 16-bit PCM,
- // and we don't yet support 8.24 or 32-bit PCM
- if (!audio_is_valid_format(format) ||
- (audio_is_linear_pcm(format) && format != AUDIO_FORMAT_PCM_16_BIT)) {
+ // further format checks are performed by createTrack_l() depending on the thread type
+ if (!audio_is_valid_format(format)) {
ALOGE("createTrack() invalid format %#x", format);
lStatus = BAD_VALUE;
goto Exit;