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

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

Fix error handling in AudioSystem::getOutputForEffect

and AudioPolicyService::getOutputForEffect.
The conventional error value for audio_io_handle_t is 0,
not a status_t cast to audio_io_handle_t.

Change-Id: I34b3fd1a50f3fa1cbf39f32eea1911112a4e094a
parent 4d973f38
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -719,7 +719,8 @@ audio_devices_t AudioSystem::getDevicesForStream(audio_stream_type_t stream)
audio_io_handle_t AudioSystem::getOutputForEffect(const effect_descriptor_t *desc)
{
    const sp<IAudioPolicyService>& aps = AudioSystem::get_audio_policy_service();
    if (aps == 0) return PERMISSION_DENIED;
    // FIXME change return type to status_t, and return PERMISSION_DENIED here
    if (aps == 0) return 0;
    return aps->getOutputForEffect(desc);
}

+2 −1
Original line number Diff line number Diff line
@@ -475,8 +475,9 @@ audio_devices_t AudioPolicyService::getDevicesForStream(audio_stream_type_t stre

audio_io_handle_t AudioPolicyService::getOutputForEffect(const effect_descriptor_t *desc)
{
    // FIXME change return type to status_t, and return NO_INIT here
    if (mpAudioPolicy == NULL) {
        return NO_INIT;
        return 0;
    }
    Mutex::Autolock _l(mLock);
    return mpAudioPolicy->get_output_for_effect(mpAudioPolicy, desc);