diff options
author | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2019-04-18 10:58:05 +0200 |
---|---|---|
committer | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2019-05-24 16:33:30 +0200 |
commit | 147e1222379a6ee5b7434a014f51ff6657b6ed3e (patch) | |
tree | 371c3dca3bf1f83b67820f83b90428f8621dc00e /lib/4a-hal-utilities/4a-hal-utilities-data.c | |
parent | 3d5de3986cc98fea301ffcc88f96a4b6ce7653e9 (diff) |
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 <jonathan.aillet@iot.bzh>
Diffstat (limited to 'lib/4a-hal-utilities/4a-hal-utilities-data.c')
-rw-r--r-- | lib/4a-hal-utilities/4a-hal-utilities-data.c | 9 |
1 files 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; |