mirror of
https://github.com/openharmony/multimedia_audio_lite.git
synced 2026-07-01 06:41:22 -04:00
Code check cleanning function nesting depth is 5
Signed-off-by: liyuhang <liyuhang24@huawei.com> Change-Id: I9122303107e38757e2f2882ab4499cd597ad3f95
This commit is contained in:
@@ -48,15 +48,16 @@ AudioSource::AudioSource()
|
||||
for (int index = 0; index < size; index++) {
|
||||
struct AudioAdapterDescriptor *desc = &descs[index];
|
||||
for (int port = 0; (desc != nullptr && port < static_cast<int>(desc->portNum)); port++) {
|
||||
if (desc->ports[port].dir == PORT_IN &&
|
||||
!(g_audioManager->LoadAdapter(g_audioManager, desc, &audioAdapter_))) {
|
||||
(void)audioAdapter_->InitAllPorts(audioAdapter_);
|
||||
if (memcpy_s(&capturePort_, sizeof(struct AudioPort),
|
||||
&desc->ports[port], sizeof(struct AudioPort))) {
|
||||
MEDIA_WARNING_LOG("memcpy_s capturePort_ failed");
|
||||
}
|
||||
break;
|
||||
if ((desc->ports[port].dir != PORT_IN) ||
|
||||
(g_audioManager->LoadAdapter(g_audioManager, desc, &audioAdapter_))) {
|
||||
continue;
|
||||
}
|
||||
(void)audioAdapter_->InitAllPorts(audioAdapter_);
|
||||
if (memcpy_s(&capturePort_, sizeof(struct AudioPort),
|
||||
&desc->ports[port], sizeof(struct AudioPort))) {
|
||||
MEDIA_WARNING_LOG("memcpy_s capturePort_ failed");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
MEDIA_DEBUG_LOG("LoadAdapter audioAdapter_");
|
||||
|
||||
Reference in New Issue
Block a user