]> git.basschouten.com Git - openhab-addons.git/commit
[pulseaudio] Apply real disconnection when needed (#13338)
authorGwendal Roulleau <dalgwen@users.noreply.github.com>
Sun, 25 Sep 2022 10:59:30 +0000 (12:59 +0200)
committerGitHub <noreply@github.com>
Sun, 25 Sep 2022 10:59:30 +0000 (12:59 +0200)
commitb7cbf2ba72bf137853c9ffbdf0392f7b0762dfbc
treea5ef571a86562d1dde8f2dd8a3c932acdef1f8a7
parentaf0ac6e474df3e163f195d7444c6a0f61a9f6e4e
[pulseaudio] Apply real disconnection when needed (#13338)

* [pulseaudio] Removing isIdle test

The isIdle boolean was not properly handled.
When disconnection is called, isIdle is not relevant : we should always honnor the disconnection request.
In fact, isIdle prevented disconnection when it is necessary (example : when a IOException occurs when sending audio to sink)

+Little bug fix on volume parsing: some volume request doesn't respond with a space after the comma separating left/right channel.

* [pulseaudio] Enhancement to the idle detection for disconnection

Using a counter to count client instead of a isIdle variable, which was not thread safe.
The PulseaudioSimpleProtocolStream parent class is now the sole responsible for closing source or sink stream.

* [pulseaudio] Small performance enhancement

Avoid a costly synchronized operation for a method called very often.

Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/PulseAudioAudioSink.java
bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/PulseAudioAudioSource.java
bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/PulseaudioSimpleProtocolStream.java
bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/cli/Parser.java
bundles/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/handler/PulseaudioHandler.java