mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-12-22 08:56:57 -05:00
Cleaned and fixed plugin ops
This commit is contained in:
parent
0114f5843f
commit
8a625fd63b
8 changed files with 293 additions and 279 deletions
|
|
@ -379,15 +379,32 @@ int conv_index(int src_format, int dst_format)
|
|||
return src_width * 32 + src_endian * 16 + sign * 8 + dst_width * 2 + dst_endian;
|
||||
}
|
||||
|
||||
int getput_index(int format)
|
||||
int get_index(int src_format, int dst_format)
|
||||
{
|
||||
int sign, width, endian;
|
||||
sign = !snd_pcm_format_signed(format);
|
||||
width = snd_pcm_format_width(format) / 8 - 1;
|
||||
sign = (snd_pcm_format_signed(src_format) !=
|
||||
snd_pcm_format_signed(dst_format));
|
||||
width = snd_pcm_format_width(src_format) / 8 - 1;
|
||||
#ifdef SND_LITTLE_ENDIAN
|
||||
endian = snd_pcm_format_big_endian(format);
|
||||
endian = snd_pcm_format_big_endian(src_format);
|
||||
#else
|
||||
endian = snd_pcm_format_little_endian(format);
|
||||
endian = snd_pcm_format_little_endian(src_format);
|
||||
#endif
|
||||
if (endian < 0)
|
||||
endian = 0;
|
||||
return width * 4 + endian * 2 + sign;
|
||||
}
|
||||
|
||||
int put_index(int src_format, int dst_format)
|
||||
{
|
||||
int sign, width, endian;
|
||||
sign = (snd_pcm_format_signed(src_format) !=
|
||||
snd_pcm_format_signed(dst_format));
|
||||
width = snd_pcm_format_width(dst_format) / 8 - 1;
|
||||
#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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue