mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -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
				
			
		| 
						 | 
					@ -286,11 +286,11 @@ static int snd_pcm_lfloat_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
 | 
				
			||||||
		err = INTERNAL(snd_pcm_hw_params_get_format)(params, &dst_format);
 | 
							err = INTERNAL(snd_pcm_hw_params_get_format)(params, &dst_format);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (snd_pcm_format_linear(src_format)) {
 | 
						if (snd_pcm_format_linear(src_format)) {
 | 
				
			||||||
		lfloat->int32_idx = snd_pcm_linear_get32_index(src_format, SND_PCM_FORMAT_S32);
 | 
							lfloat->int32_idx = snd_pcm_linear_get_index(src_format, SND_PCM_FORMAT_S32);
 | 
				
			||||||
		lfloat->float32_idx = snd_pcm_lfloat_put_s32_index(dst_format);
 | 
							lfloat->float32_idx = snd_pcm_lfloat_put_s32_index(dst_format);
 | 
				
			||||||
		lfloat->func = snd_pcm_lfloat_convert_integer_float;
 | 
							lfloat->func = snd_pcm_lfloat_convert_integer_float;
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		lfloat->int32_idx = snd_pcm_linear_put32_index(SND_PCM_FORMAT_S32, dst_format);
 | 
							lfloat->int32_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S32, dst_format);
 | 
				
			||||||
		lfloat->float32_idx = snd_pcm_lfloat_get_s32_index(src_format);
 | 
							lfloat->float32_idx = snd_pcm_lfloat_get_s32_index(src_format);
 | 
				
			||||||
		lfloat->func = snd_pcm_lfloat_convert_float_integer;
 | 
							lfloat->func = snd_pcm_lfloat_convert_float_integer;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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 snd_pcm_linear_put_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int sign, width, pwidth, endian;
 | 
						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,
 | 
					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,
 | 
								    const snd_pcm_channel_area_t *src_areas, snd_pcm_uframes_t src_offset,
 | 
				
			||||||
			    unsigned int channels, snd_pcm_uframes_t frames,
 | 
								    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);
 | 
								      snd_pcm_format_physical_width(linear->sformat) == 24);
 | 
				
			||||||
	if (linear->use_getput) {
 | 
						if (linear->use_getput) {
 | 
				
			||||||
		if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
 | 
							if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
 | 
				
			||||||
			linear->get_idx = snd_pcm_linear_get32_index(format, SND_PCM_FORMAT_S32);
 | 
								linear->get_idx = snd_pcm_linear_get_index(format, SND_PCM_FORMAT_S32);
 | 
				
			||||||
			linear->put_idx = snd_pcm_linear_put32_index(SND_PCM_FORMAT_S32, linear->sformat);
 | 
								linear->put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S32, linear->sformat);
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			linear->get_idx = snd_pcm_linear_get32_index(linear->sformat, SND_PCM_FORMAT_S32);
 | 
								linear->get_idx = snd_pcm_linear_get_index(linear->sformat, SND_PCM_FORMAT_S32);
 | 
				
			||||||
			linear->put_idx = snd_pcm_linear_put32_index(SND_PCM_FORMAT_S32, format);
 | 
								linear->put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S32, format);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
 | 
							if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -86,8 +86,6 @@ snd_pcm_sframes_t snd_pcm_plugin_undo_write_generic
 | 
				
			||||||
/* make local functions really local */
 | 
					/* make local functions really local */
 | 
				
			||||||
#define snd_pcm_linear_get_index	snd1_pcm_linear_get_index
 | 
					#define snd_pcm_linear_get_index	snd1_pcm_linear_get_index
 | 
				
			||||||
#define snd_pcm_linear_put_index	snd1_pcm_linear_put_index
 | 
					#define snd_pcm_linear_put_index	snd1_pcm_linear_put_index
 | 
				
			||||||
#define snd_pcm_linear_get32_index	snd1_pcm_linear_get32_index
 | 
					 | 
				
			||||||
#define snd_pcm_linear_put32_index	snd1_pcm_linear_put32_index
 | 
					 | 
				
			||||||
#define snd_pcm_linear_convert_index	snd1_pcm_linear_convert_index
 | 
					#define snd_pcm_linear_convert_index	snd1_pcm_linear_convert_index
 | 
				
			||||||
#define snd_pcm_linear_convert	snd1_pcm_linear_convert
 | 
					#define snd_pcm_linear_convert	snd1_pcm_linear_convert
 | 
				
			||||||
#define snd_pcm_linear_getput	snd1_pcm_linear_getput
 | 
					#define snd_pcm_linear_getput	snd1_pcm_linear_getput
 | 
				
			||||||
| 
						 | 
					@ -100,8 +98,6 @@ snd_pcm_sframes_t snd_pcm_plugin_undo_write_generic
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int snd_pcm_linear_get_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format);
 | 
					int snd_pcm_linear_get_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format);
 | 
				
			||||||
int snd_pcm_linear_put_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format);
 | 
					int snd_pcm_linear_put_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format);
 | 
				
			||||||
int snd_pcm_linear_get32_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format);
 | 
					 | 
				
			||||||
int snd_pcm_linear_put32_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format);
 | 
					 | 
				
			||||||
int snd_pcm_linear_convert_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format);
 | 
					int snd_pcm_linear_convert_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void snd_pcm_linear_convert(const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
 | 
					void snd_pcm_linear_convert(const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -569,8 +569,8 @@ static int snd_pcm_route_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
 | 
				
			||||||
	route->params.use_getput =
 | 
						route->params.use_getput =
 | 
				
			||||||
		(snd_pcm_format_physical_width(src_format) + 7) / 3 == 3 ||
 | 
							(snd_pcm_format_physical_width(src_format) + 7) / 3 == 3 ||
 | 
				
			||||||
		(snd_pcm_format_physical_width(dst_format) + 7) / 3 == 3;
 | 
							(snd_pcm_format_physical_width(dst_format) + 7) / 3 == 3;
 | 
				
			||||||
	route->params.get_idx = snd_pcm_linear_get32_index(src_format, SND_PCM_FORMAT_S32);
 | 
						route->params.get_idx = snd_pcm_linear_get_index(src_format, SND_PCM_FORMAT_S32);
 | 
				
			||||||
	route->params.put_idx = snd_pcm_linear_put32_index(SND_PCM_FORMAT_S32, dst_format);
 | 
						route->params.put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S32, dst_format);
 | 
				
			||||||
	route->params.conv_idx = snd_pcm_linear_convert_index(src_format, dst_format);
 | 
						route->params.conv_idx = snd_pcm_linear_convert_index(src_format, dst_format);
 | 
				
			||||||
	route->params.src_size = snd_pcm_format_width(src_format) / 8;
 | 
						route->params.src_size = snd_pcm_format_width(src_format) / 8;
 | 
				
			||||||
	route->params.dst_sfmt = dst_format;
 | 
						route->params.dst_sfmt = dst_format;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue