str = &pcm->stream[setup->stream];
assert(str->open);
if (str->valid_setup) {
- memcpy(setup, &str->setup, sizeof(*setup));
+ *setup = str->setup;
return 0;
}
- if ((err = pcm->ops->stream_setup(pcm, setup)) < 0)
+ if ((err = pcm->ops->stream_setup(pcm, &str->setup)) < 0)
return err;
- memcpy(&str->setup, setup, sizeof(*setup));
+ *setup = str->setup;
str->bits_per_sample = snd_pcm_format_physical_width(setup->format.format);
str->bits_per_frame = str->bits_per_sample * setup->format.channels;
str->valid_setup = 1;
plugin->name = name ? strdup(name) : NULL;
plugin->handle = handle;
plugin->stream = stream;
- memcpy(&plugin->src_format, src_format, sizeof(snd_pcm_format_t));
+ plugin->src_format = *src_format;
plugin->src_width = snd_pcm_format_physical_width(src_format->format);
assert(plugin->src_width > 0);
- memcpy(&plugin->dst_format, dst_format, sizeof(snd_pcm_format_t));
+ plugin->dst_format = *dst_format;
plugin->dst_width = snd_pcm_format_physical_width(dst_format->format);
assert(plugin->dst_width > 0);
plugin->src_channels = calloc(src_format->channels, sizeof(snd_pcm_plugin_channel_t));
snd_pcm_stream_info_t *slave_info,
snd_pcm_stream_params_t *slave_params)
{
- memcpy(slave_params, params, sizeof(*slave_params));
+ *slave_params = *params;
if ((slave_info->formats & (1 << params->format.format)) == 0) {
int format = params->format.format;
if ((snd_pcm_plug_formats(slave_info->formats) & (1 << format)) == 0)
switch (params->stream) {
case SND_PCM_STREAM_PLAYBACK:
- memcpy(&dstparams, slave_params, sizeof(*slave_params));
+ dstparams = *slave_params;
srcparams = slave_params;
- memcpy(srcparams, params, sizeof(*params));
+ *srcparams = *params;
break;
case SND_PCM_STREAM_CAPTURE:
- memcpy(&dstparams, params, sizeof(*params));
+ dstparams = *params;
srcparams = params;
- memcpy(srcparams, slave_params, sizeof(*slave_params));
+ *srcparams = *slave_params;
break;
default:
assert(0);
return -EINVAL;
}
- memcpy(&tmpparams, srcparams, sizeof(*srcparams));
+ tmpparams = *srcparams;
pdprintf("srcparams: interleave=%i, format=%i, rate=%i, channels=%i\n",
srcparams->format.interleave,