summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioMixer.h
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2012-04-16 13:43:48 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2012-04-18 17:40:48 -0700
commit9bd23229fdec1657398abc682ccccfce1c95f8aa (patch)
tree5a6790d8f19a3249b28a8b8da9e68e3a14bbde36 /services/audioflinger/AudioMixer.h
parent0ca3cf94c0dfc173ad7886ae162c4b67067539f6 (diff)
downloadframeworks_av-9bd23229fdec1657398abc682ccccfce1c95f8aa.zip
frameworks_av-9bd23229fdec1657398abc682ccccfce1c95f8aa.tar.gz
frameworks_av-9bd23229fdec1657398abc682ccccfce1c95f8aa.tar.bz2
Fix multichannel downmix pause bug on video player
Pausing a video player will cause the track audio mixer to be disabled, which causes the downmixer to be deleted. When reenabled, the track channel mask hasn't changed but the downmixer is there anymore. Fixed by: - instanciating a downmixer when the AudioMixer track gets initialized (in getTrackName(), now taking a channel mask as input), and deleted when in deleteTrackName(). - when the channel changes on a track, check whether it needs a downmixer or not. Preparing a track for downmix automatically removes the old downmixer if there was one. Also: initialize the track downmixerBufferProvider field when AudioMixer is instanciated, so we can safely call delete on it in AudioMixer's destructor, in case deleteTrackName() wasn't called before the mixer was destroyed. Change-Id: I589b0781cda5b3c82f85b561c52b08546cac21f8
Diffstat (limited to 'services/audioflinger/AudioMixer.h')
-rw-r--r--services/audioflinger/AudioMixer.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h
index 9698d0c..46deae7 100644
--- a/services/audioflinger/AudioMixer.h
+++ b/services/audioflinger/AudioMixer.h
@@ -91,7 +91,7 @@ public:
// For all APIs with "name": TRACK0 <= name < TRACK0 + MAX_NUM_TRACKS
// Allocate a track name. Returns new track name if successful, -1 on failure.
- int getTrackName();
+ int getTrackName(audio_channel_mask_t channelMask);
// Free an allocated track by name
void deleteTrackName(int name);
@@ -250,7 +250,9 @@ private:
// OK to call more often than that, but unnecessary.
void invalidateState(uint32_t mask);
+ static status_t initTrackDownmix(track_t* pTrack, int trackNum, audio_channel_mask_t mask);
static status_t prepareTrackForDownmix(track_t* pTrack, int trackNum);
+ static void unprepareTrackForDownmix(track_t* pTrack, int trackName);
static void track__genericResample(track_t* t, int32_t* out, size_t numFrames, int32_t* temp, int32_t* aux);
static void track__nop(track_t* t, int32_t* out, size_t numFrames, int32_t* temp, int32_t* aux);