Skip to content

Commit

Permalink
pcm: plug plugin - fast_ops may be changed when sw_params are set
Browse files Browse the repository at this point in the history
Link: #372
Signed-off-by: Jaroslav Kysela <[email protected]>
  • Loading branch information
perexg committed Jan 2, 2024
1 parent d4992c3 commit 19e6349
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/pcm/pcm_plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,18 @@ static int snd_pcm_plug_hw_free(snd_pcm_t *pcm)
return err;
}

static int snd_pcm_plug_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t * params)
{
snd_pcm_plug_t *plug = pcm->private_data;
snd_pcm_t *slave = plug->gen.slave;
int err = snd_pcm_sw_params(slave, params);
if (err >= 0) {
pcm->fast_ops = slave->fast_ops;
pcm->fast_op_arg = slave->fast_op_arg;
}
return err;
}

static void snd_pcm_plug_dump(snd_pcm_t *pcm, snd_output_t *out)
{
snd_pcm_plug_t *plug = pcm->private_data;
Expand All @@ -1078,7 +1090,7 @@ static const snd_pcm_ops_t snd_pcm_plug_ops = {
.hw_refine = snd_pcm_plug_hw_refine,
.hw_params = snd_pcm_plug_hw_params,
.hw_free = snd_pcm_plug_hw_free,
.sw_params = snd_pcm_generic_sw_params,
.sw_params = snd_pcm_plug_sw_params,
.channel_info = snd_pcm_generic_channel_info,
.dump = snd_pcm_plug_dump,
.nonblock = snd_pcm_generic_nonblock,
Expand Down

0 comments on commit 19e6349

Please sign in to comment.