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

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

Merge "hal: close haptics PCM device during standby"

parents 8f0bcea3 a09da007
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -4422,6 +4422,20 @@ static int out_standby(struct audio_stream *stream)
                pcm_close(out->pcm);
                out->pcm = NULL;
            }
            if (out->usecase == USECASE_AUDIO_PLAYBACK_WITH_HAPTICS) {
                if (adev->haptic_pcm) {
                    pcm_close(adev->haptic_pcm);
                    adev->haptic_pcm = NULL;
                }

                if (adev->haptic_buffer != NULL) {
                    free(adev->haptic_buffer);
                    adev->haptic_buffer = NULL;
                    adev->haptic_buffer_size = 0;
                }
                adev->haptic_pcm_device_id = 0;
            }

            if (out->usecase == USECASE_AUDIO_PLAYBACK_MMAP) {
                do_stop = out->playback_started;
                out->playback_started = false;