mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-08 17:08:24 +01:00
alsaloop: Make alsaloop working without libsamplerate
When alsaloop is built with libsamplerate, it quits immediately with No libsamplerate suppor message. It's because the check of -A option and it's set as default non-zero value. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
d6da86117b
commit
b7ea343820
1 changed files with 4 additions and 5 deletions
|
@ -387,7 +387,9 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
|
|||
int arg_nblock = 0;
|
||||
int arg_effect = 0;
|
||||
int arg_resample = 0;
|
||||
#ifdef USE_SAMPLERATE
|
||||
int arg_samplerate = SRC_SINC_FASTEST + 1;
|
||||
#else
|
||||
int arg_sync = SYNC_TYPE_AUTO;
|
||||
int arg_slave = SLAVE_TYPE_AUTO;
|
||||
int arg_thread = 0;
|
||||
|
@ -474,6 +476,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
|
|||
case 'n':
|
||||
arg_resample = 1;
|
||||
break;
|
||||
#ifdef USE_SAMPLERATE
|
||||
case 'A':
|
||||
if (strcasecmp(optarg, "sincbest") == 0)
|
||||
arg_samplerate = SRC_SINC_BEST_QUALITY;
|
||||
|
@ -491,6 +494,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
|
|||
arg_sync = SRC_SINC_FASTEST;
|
||||
arg_samplerate += 1;
|
||||
break;
|
||||
#endif
|
||||
case 'S':
|
||||
if (strcasecmp(optarg, "samplerate") == 0)
|
||||
arg_sync = SYNC_TYPE_SAMPLERATE;
|
||||
|
@ -610,11 +614,6 @@ static int parse_config(int argc, char *argv[], snd_output_t *output,
|
|||
loop->src_enable = arg_samplerate > 0;
|
||||
if (loop->src_enable)
|
||||
loop->src_converter_type = arg_samplerate - 1;
|
||||
#else
|
||||
if (arg_samplerate > 0) {
|
||||
logit(LOG_CRIT, "No libsamplerate support.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
set_loop_time(loop, arg_loop_time);
|
||||
add_loop(loop);
|
||||
|
|
Loading…
Reference in a new issue