diff gui/interface.c @ 33689:8d0290220239

Replace numeric constants for gtkEquChannels array size. Use macro FF_ARRAY_ELEMS() instead.
author ib
date Wed, 29 Jun 2011 11:35:58 +0000
parents acb61c6d14cd
children d00491caf986
line wrap: on
line diff
--- a/gui/interface.c	Wed Jun 29 11:21:09 2011 +0000
+++ b/gui/interface.c	Wed Jun 29 11:35:58 2011 +0000
@@ -32,6 +32,7 @@
 #include "help_mp.h"
 #include "input/input.h"
 #include "libaf/equalizer.h"
+#include "libavutil/common.h"
 #include "libmpcodecs/dec_audio.h"
 #include "libmpcodecs/dec_video.h"
 #include "libmpcodecs/vd.h"
@@ -597,8 +598,8 @@
             equalizer_t eq;
             int i, j;
 
-            for (i = 0; i < 6; i++) {
-                for (j = 0; j < 10; j++) {
+            for (i = 0; i < FF_ARRAY_ELEMS(gtkEquChannels); i++) {
+                for (j = 0; j < FF_ARRAY_ELEMS(*gtkEquChannels); j++) {
                     eq.channel = i;
                     eq.band    = j;
                     eq.gain    = gtkEquChannels[i][j];
@@ -1315,7 +1316,7 @@
             memset(gtkEquChannels, 0, sizeof(gtkEquChannels));
 
             if (guiInfo.afilter) {
-                for (i = 0; i < 6; i++) {
+                for (i = 0; i < FF_ARRAY_ELEMS(gtkEquChannels); i++) {
                     tmp.ch  = i;
                     tmp.arg = gtkEquChannels[i];
                     af_control_any_rev(guiInfo.afilter, AF_CONTROL_EQUALIZER_GAIN | AF_CONTROL_SET, &tmp);