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

Commit 29b4945e authored by Venkata Narendra Kumar Gutta's avatar Venkata Narendra Kumar Gutta Committed by Arne Coucheron
Browse files

hal: properly reset sample rate of VoIP data

During skype call if headset is inserted next voip
input request is failed.
VoIP data sample rate is not being reset properly is
causing the aforementioned issue.

CRs-Fixed: 725583
Change-Id: I9f85936aec0caeaf53b9aeff93a481fd38afe3ff
parent 95c18632
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -237,6 +237,7 @@ static int voip_stop_call(struct audio_device *adev)
           __func__, voip_data.out_stream_count, voip_data.in_stream_count);
           __func__, voip_data.out_stream_count, voip_data.in_stream_count);


    if (!voip_data.out_stream_count && !voip_data.in_stream_count) {
    if (!voip_data.out_stream_count && !voip_data.in_stream_count) {
        voip_data.sample_rate = 0;
        uc_info = get_usecase_from_list(adev, USECASE_COMPRESS_VOIP_CALL);
        uc_info = get_usecase_from_list(adev, USECASE_COMPRESS_VOIP_CALL);
        if (uc_info == NULL) {
        if (uc_info == NULL) {
            ALOGE("%s: Could not find the usecase (%d) in the list",
            ALOGE("%s: Could not find the usecase (%d) in the list",
@@ -263,7 +264,6 @@ static int voip_stop_call(struct audio_device *adev)


        list_remove(&uc_info->list);
        list_remove(&uc_info->list);
        free(uc_info);
        free(uc_info);
        voip_data.sample_rate = 0;
    } else
    } else
        ALOGV("%s: NO-OP because out_stream_count=%d, in_stream_count=%d",
        ALOGV("%s: NO-OP because out_stream_count=%d, in_stream_count=%d",
               __func__, voip_data.out_stream_count, voip_data.in_stream_count);
               __func__, voip_data.out_stream_count, voip_data.in_stream_count);