]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
Fix latency error check in pulse_delay() HEAD master
authorargothiel <argothiel_alsa@interia.pl>
Mon, 21 Sep 2026 00:11:52 +0000 (02:11 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 15 Oct 2026 14:32:46 +0000 (16:32 +0200)
There is an issue with `pulse_delay()` which calls
`pa_stream_get_latency()`. PulseAudio documents that this function
returns `-PA_ERR_NODATA` when timing information is not available yet.
The ALSA Pulse plugin compares the result against positive
`PA_ERR_NODATA`; it therefore treats that temporary condition as an
unrelated failure and returns `-EIO`.

Change `PA_ERR_NODATA` to `-PA_ERR_NODATA` in the comparison to not miss
that branch.

Fixes #65.

Closes: https://github.com/alsa-project/alsa-plugins/pull/67
Signed-off-by: argothiel <argothiel_alsa@interia.pl>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
pulse/pcm_pulse.c

index a201bf95aa28fa79567d8b4bafd6f79fab17bd8c..e05eaa56de287f25cbf65360d971b29ff3e99fd2 100644 (file)
@@ -396,7 +396,7 @@ static int pulse_delay(snd_pcm_ioplug_t * io, snd_pcm_sframes_t * delayp)
 
                err = pa_stream_get_latency(pcm->stream, &lat, NULL);
                if (err) {
-                       if (err != PA_ERR_NODATA) {
+                       if (err != -PA_ERR_NODATA) {
                                err = -EIO;
                                goto finish;
                        }