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

Commit b1bef51f authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Improve error logging for getOutputSamplingRate

Change-Id: I3b52402a663b27efe1d7c6a4f684521f33f3ff8f
parent aaa42e57
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -245,12 +245,14 @@ status_t AudioTrack::set(
        streamType = AUDIO_STREAM_MUSIC;
    }

    status_t status;
    if (sampleRate == 0) {
        uint32_t afSampleRate;
        if (AudioSystem::getOutputSamplingRate(&afSampleRate, streamType) != NO_ERROR) {
            return NO_INIT;
        status = AudioSystem::getOutputSamplingRate(&sampleRate, streamType);
        if (status != NO_ERROR) {
            ALOGE("Could not get output sample rate for stream type %d; status %d",
                    streamType, status);
            return status;
        }
        sampleRate = afSampleRate;
    }
    mSampleRate = sampleRate;

@@ -338,7 +340,7 @@ status_t AudioTrack::set(
    }

    // create the IAudioTrack
    status_t status = createTrack_l(streamType,
    status = createTrack_l(streamType,
                                  sampleRate,
                                  format,
                                  frameCount,