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

Commit 0206741a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "nuplayer: restart source for 24 bit WAV playback"

parents 760886a1 767c357e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -471,6 +471,7 @@ void NuPlayer::GenericSource::start() {
            * 1. kKeyPCMFormat is not set
            * 2. kKeyPCMFormat is not set to 24bit
            */
            ALOGI("Retrieving 24 bit data from source");
            CHECK_EQ(mAudioTrack.mSource->start(audioMeta.get()), (status_t)OK);
        } else {
            CHECK_EQ(mAudioTrack.mSource->start(), (status_t)OK);
+7 −7
Original line number Diff line number Diff line
@@ -628,12 +628,7 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) {
            }

            sp<MetaData> audioMeta = mSource->getFormatMeta(true /* audio */);
            if (!(ExtendedUtils::isRAWFormat(audioMeta) &&
                ExtendedUtils::is24bitPCMOffloadEnabled() &&
                ExtendedUtils::getPcmSampleBits(audioMeta) == 24)) {
                // Call mSource->start() after openAudioSink for 24 bit pcm playback
            mSource->start();
            }

            uint32_t flags = 0;

@@ -994,8 +989,9 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) {
                if ((ExtendedUtils::isRAWFormat(audioMeta) &&
                    ExtendedUtils::is24bitPCMOffloadEnabled() &&
                    ExtendedUtils::getPcmSampleBits(audioMeta) == 24)) {
                    ALOGV("update pcmformat in WAVExtractor to 16 bit");
                    ALOGI("update pcm format in WAVExtractor to 16 bit");
                    ExtendedUtils::setKeyPCMFormat(audioMeta, AUDIO_FORMAT_PCM_16_BIT );
                    mSource->stop();
                    mSource->start();
                }

@@ -1298,6 +1294,8 @@ status_t NuPlayer::instantiateDecoder(bool audio, sp<Decoder> *decoder) {
                ExtendedUtils::is24bitPCMOffloadEnabled() &&
                (ExtendedUtils::getPcmSampleBits(audioMeta) == 24)) {
                ExtendedUtils::setKeyPCMFormat(audioMeta,AUDIO_FORMAT_PCM_8_24_BIT);
                ALOGI("update pcmformat in WAVExtractor to 24 bit");
                mSource->stop();
                mSource->start();
            }
            *decoder = new DecoderPassThrough(notify);
@@ -1306,6 +1304,8 @@ status_t NuPlayer::instantiateDecoder(bool audio, sp<Decoder> *decoder) {
                ExtendedUtils::is24bitPCMOffloadEnabled() &&
                (ExtendedUtils::getPcmSampleBits(audioMeta) == 24)) {
                ExtendedUtils::setKeyPCMFormat(audioMeta,AUDIO_FORMAT_PCM_16_BIT);
                ALOGI("update pcmformat in WAVExtractor to 16 bit");
                mSource->stop();
                mSource->start();
            }
            *decoder = new Decoder(notify);