diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mixer.c | 2 | ||||
-rw-r--r-- | src/pcm.c | 6 |
2 files changed, 1 insertions, 7 deletions
diff --git a/src/mixer.c b/src/mixer.c index 742c231..e496e18 100644 --- a/src/mixer.c +++ b/src/mixer.c @@ -552,7 +552,7 @@ static int int_to_percent(const struct snd_ctl_elem_info *ei, int value) if (range == 0) return 0; - return ((value - ei->value.integer.min) / range) * 100; + return ((value - ei->value.integer.min) * 100) / range; } /** Gets a percentage representation of a specified control value. @@ -359,13 +359,7 @@ int pcm_set_config(struct pcm *pcm, const struct pcm_config *config) param_init(¶ms); param_set_mask(¶ms, SNDRV_PCM_HW_PARAM_FORMAT, pcm_format_to_alsa(config->format)); - param_set_mask(¶ms, SNDRV_PCM_HW_PARAM_SUBFORMAT, - SNDRV_PCM_SUBFORMAT_STD); param_set_min(¶ms, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, config->period_size); - param_set_int(¶ms, SNDRV_PCM_HW_PARAM_SAMPLE_BITS, - pcm_format_to_bits(config->format)); - param_set_int(¶ms, SNDRV_PCM_HW_PARAM_FRAME_BITS, - pcm_format_to_bits(config->format) * config->channels); param_set_int(¶ms, SNDRV_PCM_HW_PARAM_CHANNELS, config->channels); param_set_int(¶ms, SNDRV_PCM_HW_PARAM_PERIODS, config->period_count); |