AudioFlinger: Fix moveEffects deadlock
Occurs when srcThread and dstThread are identical.
Test: compiles
Bug: 346442777
Change-Id: Ic226cb68160fcb011594b2a07f1502fbc59b567a
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 09edf68..c43286c 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -4566,6 +4566,10 @@
if ((pt->type() == IAfThreadBase::MIXER || pt->type() == IAfThreadBase::OFFLOAD) &&
((sessionType & IAfThreadBase::EFFECT_SESSION) != 0)) {
srcThread = pt.get();
+ if (srcThread == dstThread) {
+ ALOGD("%s() same dst and src threads, ignoring move", __func__);
+ return NO_ERROR;
+ }
ALOGW("%s() found srcOutput %d hosting AUDIO_SESSION_OUTPUT_MIX", __func__,
pt->id());
break;