mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-05 13:30:00 -05:00
pcm: Drop snd_pcm_linear_{get|put}32_index()
These are identical with snd_pcm_linear_{get|put}_index().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
fd84adc63e
commit
7a5646f58b
4 changed files with 8 additions and 48 deletions
|
|
@ -107,11 +107,6 @@ int snd_pcm_linear_get_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_f
|
|||
}
|
||||
}
|
||||
|
||||
int snd_pcm_linear_get32_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format)
|
||||
{
|
||||
return snd_pcm_linear_get_index(src_format, dst_format);
|
||||
}
|
||||
|
||||
int snd_pcm_linear_put_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format)
|
||||
{
|
||||
int sign, width, pwidth, endian;
|
||||
|
|
@ -143,37 +138,6 @@ int snd_pcm_linear_put_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_f
|
|||
}
|
||||
}
|
||||
|
||||
int snd_pcm_linear_put32_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format)
|
||||
{
|
||||
int sign, width, pwidth, endian;
|
||||
sign = (snd_pcm_format_signed(src_format) !=
|
||||
snd_pcm_format_signed(dst_format));
|
||||
#ifdef SND_LITTLE_ENDIAN
|
||||
endian = snd_pcm_format_big_endian(dst_format);
|
||||
#else
|
||||
endian = snd_pcm_format_little_endian(dst_format);
|
||||
#endif
|
||||
if (endian < 0)
|
||||
endian = 0;
|
||||
pwidth = snd_pcm_format_physical_width(dst_format);
|
||||
width = snd_pcm_format_width(dst_format);
|
||||
if (pwidth == 24) {
|
||||
switch (width) {
|
||||
case 24:
|
||||
width = 0; break;
|
||||
case 20:
|
||||
width = 1; break;
|
||||
case 18:
|
||||
default:
|
||||
width = 2; break;
|
||||
}
|
||||
return width * 4 + endian * 2 + sign + 16;
|
||||
} else {
|
||||
width = width / 8 - 1;
|
||||
return width * 4 + endian * 2 + sign;
|
||||
}
|
||||
}
|
||||
|
||||
void snd_pcm_linear_convert(const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
|
||||
const snd_pcm_channel_area_t *src_areas, snd_pcm_uframes_t src_offset,
|
||||
unsigned int channels, snd_pcm_uframes_t frames,
|
||||
|
|
@ -342,11 +306,11 @@ static int snd_pcm_linear_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
|||
snd_pcm_format_physical_width(linear->sformat) == 24);
|
||||
if (linear->use_getput) {
|
||||
if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
|
||||
linear->get_idx = snd_pcm_linear_get32_index(format, SND_PCM_FORMAT_S32);
|
||||
linear->put_idx = snd_pcm_linear_put32_index(SND_PCM_FORMAT_S32, linear->sformat);
|
||||
linear->get_idx = snd_pcm_linear_get_index(format, SND_PCM_FORMAT_S32);
|
||||
linear->put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S32, linear->sformat);
|
||||
} else {
|
||||
linear->get_idx = snd_pcm_linear_get32_index(linear->sformat, SND_PCM_FORMAT_S32);
|
||||
linear->put_idx = snd_pcm_linear_put32_index(SND_PCM_FORMAT_S32, format);
|
||||
linear->get_idx = snd_pcm_linear_get_index(linear->sformat, SND_PCM_FORMAT_S32);
|
||||
linear->put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S32, format);
|
||||
}
|
||||
} else {
|
||||
if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue