mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
pcm: fix the fast_ops pcm argument for fast_ops
The fast_ops callback invocation must always pass the fast_op_arg as the pcm argument. Plugins expect that. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
78b20e3caa
commit
425e4d1fbe
4 changed files with 7 additions and 6 deletions
|
|
@ -1705,7 +1705,7 @@ int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2)
|
|||
assert(pcm1);
|
||||
assert(pcm2);
|
||||
if (pcm1->fast_ops->link)
|
||||
err = pcm1->fast_ops->link(pcm1, pcm2);
|
||||
err = pcm1->fast_ops->link(pcm1->fast_op_arg, pcm2);
|
||||
else
|
||||
err = -ENOSYS;
|
||||
return err;
|
||||
|
|
@ -1722,7 +1722,7 @@ int snd_pcm_unlink(snd_pcm_t *pcm)
|
|||
|
||||
assert(pcm);
|
||||
if (pcm->fast_ops->unlink)
|
||||
err = pcm->fast_ops->unlink(pcm);
|
||||
err = pcm->fast_ops->unlink(pcm->fast_op_arg);
|
||||
else
|
||||
err = -ENOSYS;
|
||||
return err;
|
||||
|
|
|
|||
|
|
@ -688,7 +688,7 @@ int snd_pcm_direct_check_xrun(snd_pcm_direct_t *direct, snd_pcm_t *pcm)
|
|||
* so don't increment but just update to actual counter
|
||||
*/
|
||||
direct->recoveries = direct->shmptr->s.recoveries;
|
||||
pcm->fast_ops->drop(pcm);
|
||||
pcm->fast_ops->drop(pcm->fast_op_arg);
|
||||
/* trigger_tstamp update is missing in drop callbacks */
|
||||
gettimestamp(&direct->trigger_tstamp, pcm->tstamp_type);
|
||||
/* no timer clear:
|
||||
|
|
|
|||
|
|
@ -838,7 +838,7 @@ static int snd_pcm_hw_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2)
|
|||
{
|
||||
if (pcm2->type != SND_PCM_TYPE_HW) {
|
||||
if (pcm2->fast_ops->link_slaves)
|
||||
return pcm2->fast_ops->link_slaves(pcm2, pcm1);
|
||||
return pcm2->fast_ops->link_slaves(pcm2->fast_op_arg, pcm1);
|
||||
return -ENOSYS;
|
||||
}
|
||||
return hw_link(pcm1, pcm2);
|
||||
|
|
|
|||
|
|
@ -759,8 +759,9 @@ static int snd_pcm_multi_link_slaves(snd_pcm_t *pcm, snd_pcm_t *master)
|
|||
static int snd_pcm_multi_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2)
|
||||
{
|
||||
snd_pcm_multi_t *multi = pcm1->private_data;
|
||||
if (multi->slaves[0].pcm->fast_ops->link)
|
||||
return multi->slaves[0].pcm->fast_ops->link(multi->slaves[0].pcm, pcm2);
|
||||
snd_pcm_t *main_pcm = multi->slaves[0].pcm;
|
||||
if (main_pcm->fast_ops->link)
|
||||
return main_pcm->fast_ops->link(main_pcm->fast_op_arg, pcm2);
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue