[pulseaudio-discuss] [PATCH] modargs: Don't fail needlessly in pa_modargs_get_sample_spec_and_channel_map().

Tanu Kaskinen tanuk at iki.fi
Tue May 8 20:04:52 PDT 2012


BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=49664
---
 src/pulsecore/modargs.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/pulsecore/modargs.c b/src/pulsecore/modargs.c
index 555c4d0..e80b5d6 100644
--- a/src/pulsecore/modargs.c
+++ b/src/pulsecore/modargs.c
@@ -425,8 +425,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;
-- 
1.7.10



More information about the pulseaudio-discuss mailing list