Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36f54259 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: Add change to pick codec name based mixer xml files" into audio-hal.lnx.8.0

parents d065ae96 f5d2c344
Loading
Loading
Loading
Loading
+10 −20
Original line number Diff line number Diff line
@@ -2618,30 +2618,20 @@ int audio_extn_utils_pcm_get_dsp_presentation_pos(struct stream_out *out __unuse
#define PLATFORM_INFO_XML_PATH          "audio_platform_info.xml"
#define PLATFORM_INFO_XML_BASE_STRING   "audio_platform_info"

#ifdef LINUX_ENABLED
static const char *kConfigLocationList[] =
        {"/etc"};
#else
static const char *kConfigLocationList[] =
        {"/vendor/etc"};
#endif
static const int kConfigLocationListSize =
        (sizeof(kConfigLocationList) / sizeof(kConfigLocationList[0]));

bool audio_extn_utils_resolve_config_file(char file_name[MIXER_PATH_MAX_LENGTH])
{
    char full_config_path[MIXER_PATH_MAX_LENGTH];
    for (int i = 0; i < kConfigLocationListSize; i++) {
        snprintf(full_config_path,
                 MIXER_PATH_MAX_LENGTH,
                 "%s/%s",
                 kConfigLocationList[i],
                 file_name);
    char vendor_config_path[VENDOR_CONFIG_PATH_MAX_LENGTH];

    /* Get path for audio configuration files in vendor */
    audio_get_vendor_config_path(vendor_config_path,
        sizeof(vendor_config_path));
    snprintf(full_config_path, sizeof(full_config_path),
        "%s/%s", vendor_config_path, file_name);
    if (F_OK == access(full_config_path, 0)) {
        strlcpy(file_name, full_config_path, MIXER_PATH_MAX_LENGTH);
        return true;
    }
    }
    return false;
}