mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
pcm: fix return value of snd_pcm_ioplug_sw_params()
In former commits for thread-safe PCM APIs, snd_pcm_ioplug_sw_params() got
0 as its return value, against the original implementation.
This commit fixes it.
Fixes: 54931e5a5455('pcm: Add thread-safety to PCM API')
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
4c124b0759
commit
941bd150be
1 changed files with 9 additions and 7 deletions
|
|
@ -434,14 +434,16 @@ static int snd_pcm_ioplug_hw_free(snd_pcm_t *pcm)
|
||||||
static int snd_pcm_ioplug_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
|
static int snd_pcm_ioplug_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params)
|
||||||
{
|
{
|
||||||
ioplug_priv_t *io = pcm->private_data;
|
ioplug_priv_t *io = pcm->private_data;
|
||||||
int err = 0;
|
int err;
|
||||||
|
|
||||||
|
if (!io->data->callback->sw_params)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (io->data->callback->sw_params) {
|
|
||||||
snd_pcm_unlock(pcm); /* to avoid deadlock */
|
snd_pcm_unlock(pcm); /* to avoid deadlock */
|
||||||
err = io->data->callback->sw_params(io->data, params);
|
err = io->data->callback->sw_params(io->data, params);
|
||||||
snd_pcm_lock(pcm);
|
snd_pcm_lock(pcm);
|
||||||
}
|
|
||||||
return 0;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue