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

Commit d94bb33c authored by Wei Jia's avatar Wei Jia Committed by Android (Google) Code Review
Browse files

Merge "NuPlayerDecoder: flush audio buffers when audio output format is changed."

parents 2805f438 bf898615
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -711,6 +711,10 @@ void NuPlayer::Decoder::handleOutputFormatChange(const sp<AMessage> &format) {
            flags = AUDIO_OUTPUT_FLAG_NONE;
        }

        // TODO: This is a temporary fix to flush audio buffers in renderer. The real
        // fix should be to wait for all buffers rendered normally, then open a new
        // AudioSink.
        mRenderer->flush(true /* audio */, false /* notifyComplete */);
        status_t err = mRenderer->openAudioSink(
                format, false /* offloadOnly */, hasVideo, flags, NULL /* isOffloaed */);
        if (err != OK) {