From c4b88a8d0f524666bf0f390075c334d047a104f2 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Wed, 30 Apr 2014 16:54:30 -0700 Subject: 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 --- services/audioflinger/AudioFlinger.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'services/audioflinger') 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 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; -- cgit v1.1