]> git.alsa-project.org Git - alsa-lib.git/commitdiff
pcm: Drop snd_pcm_linear_{get|put}32_index()
authorTakashi Iwai <tiwai@suse.de>
Tue, 22 Jul 2014 10:20:50 +0000 (12:20 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 22 Jul 2014 12:20:40 +0000 (14:20 +0200)
These are identical with snd_pcm_linear_{get|put}_index().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm_lfloat.c
src/pcm/pcm_linear.c
src/pcm/pcm_plugin.h
src/pcm/pcm_route.c

index 324282f0b7fce8afe1c68022ded0df60a139f748..2f3e578fc5034244ff59d6aa2f711da79e2dfe79 100644 (file)
@@ -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);
        }
        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->func = snd_pcm_lfloat_convert_integer_float;
        } 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->func = snd_pcm_lfloat_convert_float_integer;
        }
index 3d5bbb8a36885ea4258731f22809eaf3a881ca26..9a92abd04fb8f4c85e3e838e63d9e15edfcc6949 100644 (file)
@@ -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)
index 19e82c3e7321b1ef01dc1f80800fd7ff63844543..b0a3e1869ea1a32bb998a0f5a4949532703da879 100644 (file)
@@ -86,8 +86,6 @@ snd_pcm_sframes_t snd_pcm_plugin_undo_write_generic
 /* make local functions really local */
 #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_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 snd1_pcm_linear_convert
 #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_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);
 
 void snd_pcm_linear_convert(const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
index 5dac7ebcb7df65d18a64abbee9d700533d0a3b86..e7de9b51f1fcc0708bbd59167269a6e4f3f4678e 100644 (file)
@@ -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 =
                (snd_pcm_format_physical_width(src_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.put_idx = snd_pcm_linear_put32_index(SND_PCM_FORMAT_S32, dst_format);
+       route->params.get_idx = snd_pcm_linear_get_index(src_format, SND_PCM_FORMAT_S32);
+       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.src_size = snd_pcm_format_width(src_format) / 8;
        route->params.dst_sfmt = dst_format;