Fix for frame size not byte aligned

This commit is contained in:
Abramo Bagnara 2000-06-05 15:28:39 +00:00
parent ee5465d113
commit 7fe55fff6a
3 changed files with 22 additions and 14 deletions

View file

@ -85,7 +85,7 @@ static ssize_t mmap_src_channels(snd_pcm_plugin_t *plugin,
assert(snd_pcm_mmap_ready(data->slave, plugin->stream));
}
pos = ctrl->byte_data % setup->buffer_size;
assert((pos * 8) % stream->bits_per_frame == 0);
assert(pos % setup->bytes_align == 0);
pos = (pos * 8) / stream->bits_per_frame;
sv = plugin->src_channels;
@ -156,7 +156,7 @@ static ssize_t mmap_dst_channels(snd_pcm_plugin_t *plugin,
assert(snd_pcm_mmap_ready(data->slave, plugin->stream));
}
pos = ctrl->byte_data % setup->buffer_size;
assert((pos * 8) % stream->bits_per_frame == 0);
assert(pos % setup->bytes_align == 0);
pos = (pos * 8) / stream->bits_per_frame;
sv = stream->channels;