[polypaudio-commits] r801 - /trunk/src/polyp/channelmap.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Wed Apr 26 08:37:14 PDT 2006
Author: lennart
Date: Wed Apr 26 17:37:13 2006
New Revision: 801
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=801&root=polypaudio&view=rev
Log:
don't allow channel positions to be specified twice in the same channelmap
Modified:
trunk/src/polyp/channelmap.c
Modified: trunk/src/polyp/channelmap.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/channelmap.c?rev=801&root=polypaudio&r1=800&r2=801&view=diff
==============================================================================
--- trunk/src/polyp/channelmap.c (original)
+++ trunk/src/polyp/channelmap.c Wed Apr 26 17:37:13 2006
@@ -277,10 +277,19 @@
if (map->channels <= 0 || map->channels > PA_CHANNELS_MAX)
return 0;
- for (c = 0; c < map->channels; c++)
+ for (c = 0; c < map->channels; c++) {
+ unsigned k;
+
if (map->map[c] < 0 ||map->map[c] >= PA_CHANNEL_POSITION_MAX)
return 0;
+ /* Don't allow positions to be specified twice */
+ for (k = 0; k < c; k++)
+ if (map->map[k] == map->map[c])
+ return 0;
+
+ }
+
return 1;
}
More information about the pulseaudio-commits
mailing list