Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a9aa4f5 authored by Glenn Kasten's avatar Glenn Kasten Committed by Android (Google) Code Review
Browse files

Merge "Fix bug for direct track with PCM != 16-bit"

parents ad3770a2 c4b88a8d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1005,7 +1005,8 @@ status_t AudioTrack::createTrack_l(size_t epoch)
    sp<IAudioTrack> track = audioFlinger->createTrack(mStreamType,
                                                      mSampleRate,
                                                      // AudioFlinger only sees 16-bit PCM
                                                      mFormat == AUDIO_FORMAT_PCM_8_BIT ?
                                                      mFormat == AUDIO_FORMAT_PCM_8_BIT &&
                                                          !(mFlags & AUDIO_OUTPUT_FLAG_DIRECT) ?
                                                              AUDIO_FORMAT_PCM_16_BIT : mFormat,
                                                      mChannelMask,
                                                      &temp,
+2 −4
Original line number Diff line number Diff line
@@ -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;