summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-06-20 12:26:32 -0700
committerEric Laurent <elaurent@google.com>2012-06-20 12:26:32 -0700
commit22167855ff9af7b13fda669ca27c67a037a7d585 (patch)
tree173d9cb6b65734e259df2b311a4e3e18956fe49b /services
parent5f12136299918ea30555f3481668ec0dbb775e5f (diff)
downloadframeworks_av-22167855ff9af7b13fda669ca27c67a037a7d585.zip
frameworks_av-22167855ff9af7b13fda669ca27c67a037a7d585.tar.gz
frameworks_av-22167855ff9af7b13fda669ca27c67a037a7d585.tar.bz2
audioflinger: fix setStreamOutput()
AudioFlinger::setStreamOutput() should also work for direct outputs. Also ignore the destination output specified to match the expected behavior which is to invalidate all tracks using the specified stream type so that they can be re created on the correct ouput thread. Do not send STREAM_CONFIG_CHANGED event wich is ignored by AudioSystem anyway since the stream to output cache has been removed. Change-Id: I13d9d47922923b630dd755717875424c16be4637
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/AudioFlinger.cpp14
-rw-r--r--services/audioflinger/AudioFlinger.h3
2 files changed, 4 insertions, 13 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index b78c6d1..50fde86 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -3359,7 +3359,7 @@ void AudioFlinger::PlaybackThread::cacheParameters_l()
idleSleepTime = idleSleepTimeUs();
}
-void AudioFlinger::MixerThread::invalidateTracks(audio_stream_type_t streamType)
+void AudioFlinger::PlaybackThread::invalidateTracks(audio_stream_type_t streamType)
{
ALOGV ("MixerThread::invalidateTracks() mixer %p, streamType %d, mTracks.size %d",
this, streamType, mTracks.size());
@@ -7026,21 +7026,11 @@ status_t AudioFlinger::closeInput(audio_io_handle_t input)
status_t AudioFlinger::setStreamOutput(audio_stream_type_t stream, audio_io_handle_t output)
{
Mutex::Autolock _l(mLock);
- MixerThread *dstThread = checkMixerThread_l(output);
- if (dstThread == NULL) {
- ALOGW("setStreamOutput() bad output id %d", output);
- return BAD_VALUE;
- }
-
ALOGV("setStreamOutput() stream %d to output %d", stream, output);
- audioConfigChanged_l(AudioSystem::STREAM_CONFIG_CHANGED, output, &stream);
for (size_t i = 0; i < mPlaybackThreads.size(); i++) {
PlaybackThread *thread = mPlaybackThreads.valueAt(i).get();
- if (thread != dstThread && thread->type() != ThreadBase::DIRECT) {
- MixerThread *srcThread = (MixerThread *)thread;
- srcThread->invalidateTracks(stream);
- }
+ thread->invalidateTracks(stream);
}
return NO_ERROR;
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 384306c..9e42ae2 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -1016,6 +1016,8 @@ public:
virtual status_t setSyncEvent(const sp<SyncEvent>& event);
virtual bool isValidSyncEvent(const sp<SyncEvent>& event);
+ void invalidateTracks(audio_stream_type_t streamType);
+
protected:
int16_t* mMixBuffer;
@@ -1143,7 +1145,6 @@ public:
// Thread virtuals
- void invalidateTracks(audio_stream_type_t streamType);
virtual bool checkForNewParameters_l();
virtual status_t dumpInternals(int fd, const Vector<String16>& args);