mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
pcm: plugin status - fix the return value (regression)
The snd_pcm_plugin_avail_update() error code in snd_pcm_plugin_status()
should not be reported to the caller. The state errors can be determined
using the state member in the status structure.
Fixes: 4f90392f07 ("pcm: fix the snd_pcm_plugin_status() avail and delay fields")
BugLink: https://github.com/alsa-project/alsa-lib/issues/107
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
6c24cd2e60
commit
afe6ff3b33
1 changed files with 3 additions and 5 deletions
|
|
@ -541,19 +541,17 @@ static snd_pcm_sframes_t snd_pcm_plugin_avail_update(snd_pcm_t *pcm)
|
|||
static int snd_pcm_plugin_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
|
||||
{
|
||||
snd_pcm_plugin_t *plugin = pcm->private_data;
|
||||
snd_pcm_sframes_t err, avail;
|
||||
snd_pcm_sframes_t err;
|
||||
|
||||
/* sync with the latest hw and appl ptrs */
|
||||
avail = snd_pcm_plugin_avail_update(pcm);
|
||||
if (avail < 0)
|
||||
return avail;
|
||||
snd_pcm_plugin_avail_update(pcm);
|
||||
|
||||
err = snd_pcm_status(plugin->gen.slave, status);
|
||||
if (err < 0)
|
||||
return err;
|
||||
status->appl_ptr = *pcm->appl.ptr;
|
||||
status->hw_ptr = *pcm->hw.ptr;
|
||||
status->avail = avail;
|
||||
status->avail = snd_pcm_mmap_avail(pcm);
|
||||
status->delay = snd_pcm_mmap_delay(pcm);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue