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

Commit bd9745ad authored by Steve Kondik's avatar Steve Kondik
Browse files

nuplayer: Fix audio format override for PCM offload

 * Only override the audioformat if it's linear PCM.

Change-Id: I394b33c37048e408105f550055863d3580bb8305
parent 7bd8857e
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1491,11 +1491,13 @@ status_t NuPlayer::Renderer::onOpenAudioSink(
            onDisableOffloadAudio();
        } else {
#ifdef ENABLE_AV_ENHANCEMENTS
            if (audio_is_linear_pcm(audioFormat)) {
                if (bitsPerSample > 16 && ExtendedUtils::is24bitPCMOffloadEnabled()) {
                    audioFormat = AUDIO_FORMAT_PCM_24_BIT_OFFLOAD;
                } else if (ExtendedUtils::is16bitPCMOffloadEnabled()) {
                    audioFormat = AUDIO_FORMAT_PCM_16_BIT_OFFLOAD;
                }
            }
#endif
            ALOGV("Mime \"%s\" mapped to audio_format 0x%x",
                    mime.c_str(), audioFormat);