]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Allow negative coefficients in route plugin
authorTakashi Iwai <tiwai@suse.de>
Thu, 6 Apr 2006 17:03:16 +0000 (19:03 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 6 Apr 2006 17:03:16 +0000 (19:03 +0200)
Allow negative coefficients in route plugin (when handled as float).

src/pcm/pcm_route.c

index a7f7699b6b084d4abd21c8b592b86dd42dd345e0..e49bdefdbf570da7849e36f347a90abb17726afc 100644 (file)
@@ -794,7 +794,6 @@ static int route_load_ttable(snd_pcm_route_params_t *params, snd_pcm_stream_t st
                for (src_channel = 0; src_channel < sused; ++src_channel) {
                        snd_pcm_route_ttable_entry_t v;
                        v = ttable[src_channel * smul + dst_channel * dmul];
-                       assert(v >= 0 && v <= SND_PCM_PLUGIN_ROUTE_FULL);
                        if (v != 0) {
                                srcs[nsrcs].channel = src_channel;
 #if SND_PCM_PLUGIN_ROUTE_FLOAT
@@ -802,6 +801,7 @@ static int route_load_ttable(snd_pcm_route_params_t *params, snd_pcm_stream_t st
                                srcs[nsrcs].as_int = (v == SND_PCM_PLUGIN_ROUTE_FULL ? SND_PCM_PLUGIN_ROUTE_RESOLUTION : 0);
                                srcs[nsrcs].as_float = v;
 #else
+                               assert(v >= 0 && v <= SND_PCM_PLUGIN_ROUTE_FULL);
                                srcs[nsrcs].as_int = v;
 #endif
                                if (v != SND_PCM_PLUGIN_ROUTE_FULL)