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

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

Merge "hal: Ensure all the mutexes are initialized"

parents bcfbd1ad 40703105
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -580,6 +580,11 @@ void audio_extn_usb_init(void *adev)
    usbmod->proxy_card = 0;
    usbmod->proxy_device_id = AFE_PROXY_PLAYBACK_DEVICE;
    usbmod->adev = (struct audio_device*)adev;

     pthread_mutex_init(&usbmod->usb_playback_lock,
                        (const pthread_mutexattr_t *) NULL);
     pthread_mutex_init(&usbmod->usb_record_lock,
                        (const pthread_mutexattr_t *) NULL);
}

void audio_extn_usb_deinit()
+4 −0
Original line number Diff line number Diff line
@@ -2601,6 +2601,8 @@ static int adev_open_input_stream(struct audio_hw_device *dev,

    in = (struct stream_in *)calloc(1, sizeof(struct stream_in));

    pthread_mutex_init(&in->lock, (const pthread_mutexattr_t *) NULL);

    in->stream.common.get_sample_rate = in_get_sample_rate;
    in->stream.common.set_sample_rate = in_set_sample_rate;
    in->stream.common.get_buffer_size = in_get_buffer_size;
@@ -2735,6 +2737,8 @@ static int adev_open(const hw_module_t *module, const char *name,

    adev = calloc(1, sizeof(struct audio_device));

    pthread_mutex_init(&adev->lock, (const pthread_mutexattr_t *) NULL);

    adev->device.common.tag = HARDWARE_DEVICE_TAG;
    adev->device.common.version = AUDIO_DEVICE_API_VERSION_2_0;
    adev->device.common.module = (struct hw_module_t *)module;