]> git.tue.mpg.de Git - paraslash.git/commitdiff
alsa: Ignore errors from the btr query.
authorAndre Noll <maan@systemlinux.org>
Wed, 13 Jan 2010 06:16:32 +0000 (07:16 +0100)
committerAndre Noll <maan@systemlinux.org>
Wed, 13 Jan 2010 06:16:32 +0000 (07:16 +0100)
Just use default values in case samplerate and channels can not
be obtained from parent nodes of the buffer tree.

alsa_write.c

index 658183eacafca7ba9385177185b72392cf78d3d0..11fc58a45608f73d4aa4c16c617a6f65e08d0476 100644 (file)
@@ -332,17 +332,13 @@ again:
                pad->channels = conf->channels_arg;
                if (!conf->samplerate_given) { /* config option trumps btr_exec */
                        int32_t rate;
-                       ret = get_btr_samplerate(btrn, &rate);
-                       if (ret < 0)
-                               goto err;
-                       pad->samplerate = rate;
+                       if (get_btr_samplerate(btrn, &rate) >= 0)
+                               pad->samplerate = rate;
                }
                if (!conf->channels_given) {
                        int32_t ch;
-                       ret = get_btr_channels(btrn, &ch);
-                       if (ret < 0)
-                               goto err;
-                       pad->channels = ch;
+                       if (get_btr_channels(btrn, &ch) >= 0)
+                               pad->channels = ch;
                }
                PARA_INFO_LOG("%d channel(s), %dHz\n", pad->channels, pad->samplerate);
                ret = 1;