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

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

nuplayer: Always copy duration to output format message

 * In the case of PCM offload, we need to make sure the format is copied
   because we might not have it here.

Change-Id: Icd4ae5ceff66b24e83fe6a2b9a07ec8934590678
parent 2face62c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1168,6 +1168,11 @@ void NuPlayer::openAudioSink(const sp<AMessage> &format, bool offloadOnly) {
        flags = AUDIO_OUTPUT_FLAG_NONE;
    }


    format->setInt64("durationUs", durationUs);

    ALOGV("openAudioSink: format=%s", format->debugString().c_str());

    mOffloadAudio = mRenderer->openAudioSink(
            format, offloadOnly, (mVideoDecoder != NULL), flags);

+1 −1
Original line number Diff line number Diff line
@@ -1399,7 +1399,7 @@ bool NuPlayer::Renderer::onOpenAudioSink(
        sp<MetaData> aMeta = new MetaData;
        convertMessageToMetaData(format, aMeta);
        if  (canOffloadStream(aMeta, false, new MetaData,
                    true, AUDIO_STREAM_MUSIC)) {
                    hasVideo, AUDIO_STREAM_MUSIC)) {
            mFlags |= FLAG_OFFLOAD_AUDIO;
        }
    }