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

Commit 578a36a1 authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge changes I01ad15fa,I428e9f0c,I49ea4d01,I4dcc9f6d,Ibfeb9ae3, ... into sc-dev

* changes:
  audiopolicy: avoid unnecessary closure of HOTWORD recording.
  audiopolicy: Add support for multiple display ports.
  audiopolicy: Wrong device selection for music during concurrency.
  audiopolicy: fix voice volume mismatch after headset removal.
  nuplayer: handle setPlaybackSettings on direct tracks.
  libmedia: modify conditions to reuse track.
parents ec53dfa4 408349af
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -662,9 +662,7 @@ public:
     *  handle on audio hardware output, or AUDIO_IO_HANDLE_NONE if the
     *  track needed to be re-created but that failed
     */
private:
            audio_io_handle_t    getOutput() const;
public:

    /* Selects the audio device to use for output of this AudioTrack. A value of
     * AUDIO_PORT_HANDLE_NONE indicates default (AudioPolicyManager) routing.
+6 −0
Original line number Diff line number Diff line
@@ -2246,6 +2246,12 @@ status_t MediaPlayerService::AudioOutput::open(
                      mRecycledTrack->frameCount(), t->frameCount());
                reuse = false;
            }
            // If recycled and new tracks are not on the same output,
            // don't reuse the recycled one.
            if (mRecycledTrack->getOutput() != t->getOutput()) {
                ALOGV("output has changed, don't reuse track");
                reuse = false;
            }
        }

        if (reuse) {
+1 −0
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ class MediaPlayerService : public BnMediaPlayerService
        virtual audio_session_t getSessionId() const;
        virtual uint32_t        getSampleRate() const;
        virtual int64_t         getBufferDurationInUs() const;
        virtual audio_output_flags_t getFlags() const { return mFlags; }

        virtual status_t        open(
                uint32_t sampleRate, int channelCount, audio_channel_mask_t channelMask,
+1 −0
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ public:
        virtual audio_stream_type_t getAudioStreamType() const = 0;
        virtual uint32_t    getSampleRate() const = 0;
        virtual int64_t     getBufferDurationInUs() const = 0;
        virtual audio_output_flags_t getFlags() const = 0;

        // If no callback is specified, use the "write" API below to submit
        // audio data.
+6 −4
Original line number Diff line number Diff line
@@ -871,10 +871,12 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) {
            readFromAMessage(msg, &rate);
            status_t err = OK;
            if (mRenderer != NULL) {
                // AudioSink allows only 1.f and 0.f for offload mode.
                // For other speed, switch to non-offload mode.
                if (mOffloadAudio && ((rate.mSpeed != 0.f && rate.mSpeed != 1.f)
                        || rate.mPitch != 1.f)) {
                // AudioSink allows only 1.f and 0.f for offload and direct modes.
                // For other speeds, restart audio to fallback to supported paths
                bool audioDirectOutput = (mAudioSink->getFlags() & AUDIO_OUTPUT_FLAG_DIRECT) != 0;
                if ((mOffloadAudio || audioDirectOutput) &&
                        ((rate.mSpeed != 0.f && rate.mSpeed != 1.f) || rate.mPitch != 1.f)) {

                    int64_t currentPositionUs;
                    if (getCurrentPosition(&currentPositionUs) != OK) {
                        currentPositionUs = mPreviousSeekTimeUs;
Loading