From 147e1222379a6ee5b7434a014f51ff6657b6ed3e Mon Sep 17 00:00:00 2001 From: Jonathan Aillet Date: Thu, 18 Apr 2019 10:58:05 +0200 Subject: Improve search for mixer data in linked list Improve search for specific mixer data in linked list when the search is using stream properties. BUG-AGL: SPEC-2329 Change-Id: Idd5ea0540ace508b8b8351f38a3832f7d0f8a760 Signed-off-by: Jonathan Aillet --- lib/4a-hal-utilities/4a-hal-utilities-data.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/4a-hal-utilities/4a-hal-utilities-data.c b/lib/4a-hal-utilities/4a-hal-utilities-data.c index 1e20c59..8f30596 100644 --- a/lib/4a-hal-utilities/4a-hal-utilities-data.c +++ b/lib/4a-hal-utilities/4a-hal-utilities-data.c @@ -132,14 +132,15 @@ struct InternalHalMixerData *HalUtlSearchMixerDataByProperties(struct InternalHa { struct InternalHalMixerData *currentMixerData; - if(! mixerDataList || ! *mixerDataList || ! verb) + if(! mixerDataList || ! *mixerDataList || ! verb || ! verbToCall) return NULL; currentMixerData = *mixerDataList; while(currentMixerData) { - if((! strcmp(verb, currentMixerData->verb)) && - (! strcmp(verbToCall, currentMixerData->verbToCall)) && - (! strcmp(streamCardId, currentMixerData->streamCardId))) + if(! strcmp(verb, currentMixerData->verb) && + ! strcmp(verbToCall, currentMixerData->verbToCall) && + ((! streamCardId && ! currentMixerData->streamCardId) || + (streamCardId && currentMixerData->streamCardId && ! strcmp(streamCardId, currentMixerData->streamCardId)))) return currentMixerData; currentMixerData = currentMixerData->next; -- cgit 1.2.3-korg