]> git.alsa-project.org Git - alsa-utils.git/commitdiff
alsaloop: Make alsaloop working without libsamplerate
authorTakashi Iwai <tiwai@suse.de>
Fri, 30 Nov 2012 13:35:31 +0000 (14:35 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 30 Nov 2012 13:35:31 +0000 (14:35 +0100)
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>
alsaloop/alsaloop.c

index 8710dd19d083d4f4becd240bf0651141190696dc..6e9456478d074e683c532452082eb2192252430f 100644 (file)
@@ -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);