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

Commit 34b83b90 authored by Naresh Tanniru's avatar Naresh Tanniru Committed by Steve Kondik
Browse files

AudioPolicy: Reject offloading for non-music streams

- Reject output request if called with non-music stream
  type but with AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD

- This will allow the client to fall back to SW decode or
  deal with the error appropriately.

Change-Id: Ib7a805a884b02b3e5169da334292dfb776fe41bf
parent 717e2254
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1239,6 +1239,13 @@ audio_io_handle_t AudioPolicyManager::getOutputForDevice(
    }
#endif //AUDIO_POLICY_TEST

    if (((flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) != 0) &&
            (stream != AUDIO_STREAM_MUSIC)) {
        // compress should not be used for non-music streams
        ALOGE("Offloading only allowed with music stream");
        return 0;
    }

#ifdef VOICE_CONCURRENCY
    char propValue[PROPERTY_VALUE_MAX];
    bool prop_play_enabled=false, prop_voip_enabled = false;