]> code.delx.au - pulseaudio/commitdiff
modargs: Don't fail needlessly in pa_modargs_get_sample_spec_and_channel_map().
authorTanu Kaskinen <tanuk@iki.fi>
Wed, 9 May 2012 03:04:52 +0000 (06:04 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Wed, 19 Dec 2012 10:31:50 +0000 (12:31 +0200)
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=49664
src/pulsecore/modargs.c

index e86ffa551426b2ec94dea684ec8f3c067e001fcb..0abc2436b30746256200cd4eeedb883f3053831a 100644 (file)
@@ -453,8 +453,12 @@ int pa_modargs_get_sample_spec_and_channel_map(
     if (pa_modargs_get_channel_map(ma, NULL, &map) < 0)
         return -1;
 
-    if (map.channels != ss.channels)
-        return -1;
+    if (map.channels != ss.channels) {
+        if (!pa_modargs_get_value(ma, "channels", NULL))
+            ss.channels = map.channels;
+        else
+            return -1;
+    }
 
     *rmap = map;
     *rss = ss;