Loading services/audiopolicy/common/managerdefinitions/src/AudioInputDescriptor.cpp +12 −6 Original line number Diff line number Diff line Loading @@ -257,15 +257,21 @@ void AudioInputDescriptor::stop() void AudioInputDescriptor::close() { if (mIoHandle != AUDIO_IO_HANDLE_NONE) { // clean up active clients if any (can happen if close() is called to force // clients to reconnect for (const auto &client : getClientIterable()) { if (client->active()) { ALOGW("%s client with port ID %d still active on input %d", __func__, client->portId(), mId); setClientActive(client, false); stop(); } } mClientInterface->closeInput(mIoHandle); LOG_ALWAYS_FATAL_IF(mProfile->curOpenCount < 1, "%s profile open count %u", __FUNCTION__, mProfile->curOpenCount); // do not call stop() here as stop() is supposed to be called after // setClientActive(client, false) and we don't know how many clients // are still active at this time if (isActive()) { mProfile->curActiveCount--; } mProfile->curOpenCount--; LOG_ALWAYS_FATAL_IF(mProfile->curOpenCount < mProfile->curActiveCount, "%s(%d): mProfile->curOpenCount %d < mProfile->curActiveCount %d.", Loading services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp +11 −5 Original line number Diff line number Diff line Loading @@ -563,6 +563,17 @@ void SwAudioOutputDescriptor::stop() void SwAudioOutputDescriptor::close() { if (mIoHandle != AUDIO_IO_HANDLE_NONE) { // clean up active clients if any (can happen if close() is called to force // clients to reconnect for (const auto &client : getClientIterable()) { if (client->active()) { ALOGW("%s client with port ID %d still active on output %d", __func__, client->portId(), mId); setClientActive(client, false); stop(); } } AudioParameter param; param.add(String8("closing"), String8("true")); mClientInterface->setParameters(mIoHandle, param.toString()); Loading @@ -571,11 +582,6 @@ void SwAudioOutputDescriptor::close() LOG_ALWAYS_FATAL_IF(mProfile->curOpenCount < 1, "%s profile open count %u", __FUNCTION__, mProfile->curOpenCount); // do not call stop() here as stop() is supposed to be called after setClientActive(false) // and we don't know how many streams are still active at this time if (isActive()) { mProfile->curActiveCount--; } mProfile->curOpenCount--; mIoHandle = AUDIO_IO_HANDLE_NONE; } Loading Loading
services/audiopolicy/common/managerdefinitions/src/AudioInputDescriptor.cpp +12 −6 Original line number Diff line number Diff line Loading @@ -257,15 +257,21 @@ void AudioInputDescriptor::stop() void AudioInputDescriptor::close() { if (mIoHandle != AUDIO_IO_HANDLE_NONE) { // clean up active clients if any (can happen if close() is called to force // clients to reconnect for (const auto &client : getClientIterable()) { if (client->active()) { ALOGW("%s client with port ID %d still active on input %d", __func__, client->portId(), mId); setClientActive(client, false); stop(); } } mClientInterface->closeInput(mIoHandle); LOG_ALWAYS_FATAL_IF(mProfile->curOpenCount < 1, "%s profile open count %u", __FUNCTION__, mProfile->curOpenCount); // do not call stop() here as stop() is supposed to be called after // setClientActive(client, false) and we don't know how many clients // are still active at this time if (isActive()) { mProfile->curActiveCount--; } mProfile->curOpenCount--; LOG_ALWAYS_FATAL_IF(mProfile->curOpenCount < mProfile->curActiveCount, "%s(%d): mProfile->curOpenCount %d < mProfile->curActiveCount %d.", Loading
services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp +11 −5 Original line number Diff line number Diff line Loading @@ -563,6 +563,17 @@ void SwAudioOutputDescriptor::stop() void SwAudioOutputDescriptor::close() { if (mIoHandle != AUDIO_IO_HANDLE_NONE) { // clean up active clients if any (can happen if close() is called to force // clients to reconnect for (const auto &client : getClientIterable()) { if (client->active()) { ALOGW("%s client with port ID %d still active on output %d", __func__, client->portId(), mId); setClientActive(client, false); stop(); } } AudioParameter param; param.add(String8("closing"), String8("true")); mClientInterface->setParameters(mIoHandle, param.toString()); Loading @@ -571,11 +582,6 @@ void SwAudioOutputDescriptor::close() LOG_ALWAYS_FATAL_IF(mProfile->curOpenCount < 1, "%s profile open count %u", __FUNCTION__, mProfile->curOpenCount); // do not call stop() here as stop() is supposed to be called after setClientActive(false) // and we don't know how many streams are still active at this time if (isActive()) { mProfile->curActiveCount--; } mProfile->curOpenCount--; mIoHandle = AUDIO_IO_HANDLE_NONE; } Loading