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

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

Merge "hal: fix dts logging for fade node"

parents bd5401d4 ca2b3e1a
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -136,7 +136,19 @@ static int do_DTS_Eagle_params(const struct audio_device *adev, struct dts_eagle
}

static void fade_node(bool need_data) {
    int fd = creat(FADE_NOTIFY_FILE, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH), n = 0;
    char prop[PROPERTY_VALUE_MAX];
    property_get("use.dts_eagle", prop, "0");
    if (strncmp("true", prop, sizeof("true")))
        return;
    int fd, n = 0;
    if ((fd = open(FADE_NOTIFY_FILE, O_RDONLY)) < 0)
        ALOGV("No fade node");
    else {
        ALOGV("fade node exists, remove it before creating it");
        close(fd);
        remove(FADE_NOTIFY_FILE);
    }
    fd = creat(FADE_NOTIFY_FILE, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
    char *str = need_data ? "need" : "have";
    if (fd < 0) {
        ALOGE("DTS_EAGLE_HAL (%s): opening fade notifier node failed", __func__);
@@ -301,7 +313,6 @@ void audio_extn_dts_eagle_set_parameters(struct audio_device *adev, struct str_p
        if (fade_in > 0 && fade_in_data && fade_out_data)
            fade_node(false);
    }

    ALOGV("DTS_EAGLE_HAL (%s): exit", __func__);
}

@@ -427,11 +438,10 @@ void audio_extn_dts_create_state_notifier_node(int stream_out)
        chmod(path, S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH);
        ALOGV("DTS_EAGLE_NODE_STREAM (%s): opening state notifier node successful", __func__);
        close(fd);
    }

        if (!fade_in_data || !fade_out_data)
            fade_node(true);
    }
}

void audio_extn_dts_notify_playback_state(int stream_out, int has_video, int sample_rate,
                           int channels, int is_playing) {