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

Commit 644678d3 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: Fixes in audio patch removal and device utilities"

parents 5b39a6a3 ce2b9fab
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -449,13 +449,14 @@ audio_devices_t get_device_types(struct listnode *devices)
bool is_single_device_type_equal(struct listnode *devices,
                                 audio_devices_t type)
{
    struct listnode *node = devices;
    struct listnode *node;
    struct audio_device_info *item = NULL;

    if (devices == NULL)
        return false;

    if (list_length(devices) == 1) {
        node = devices->next;
        item = node_to_item(node, struct audio_device_info, list);
        if (item != NULL && (item->type == type))
            return true;
+5 −4
Original line number Diff line number Diff line
@@ -9881,9 +9881,10 @@ int adev_release_audio_patch(struct audio_hw_device *dev,
    }

    // Remove patch and reset patch handle in stream info
    patch_type_t patch_type = p_info->patch_type;
    patch_map_remove_l(adev, handle);
    if (p_info->patch_type == PATCH_PLAYBACK ||
        p_info->patch_type == PATCH_CAPTURE) {
    if (patch_type == PATCH_PLAYBACK ||
        patch_type == PATCH_CAPTURE) {
        struct audio_stream_info *s_info =
            hashmapGet(adev->io_streams_map, (void *) (intptr_t) io_handle);
        if (s_info == NULL) {
@@ -9899,9 +9900,9 @@ int adev_release_audio_patch(struct audio_hw_device *dev,
    if (stream != NULL) {
        struct listnode devices;
        list_init(&devices);
        if (p_info->patch_type == PATCH_PLAYBACK)
        if (patch_type == PATCH_PLAYBACK)
            ret = route_output_stream((struct stream_out *) stream, &devices);
        else if (p_info->patch_type == PATCH_CAPTURE)
        else if (patch_type == PATCH_CAPTURE)
            ret = route_input_stream((struct stream_in *) stream, &devices, input_source);
    }