[MPlayer-cvslog] r33777 - in trunk/gui: interface.c ui/gtk/equalizer.c
ib
subversion at mplayerhq.hu
Wed Jun 29 13:35:58 CEST 2011
Author: ib
Date: Wed Jun 29 13:35:58 2011
New Revision: 33777
Log:
Replace numeric constants for gtkEquChannels array size.
Use macro FF_ARRAY_ELEMS() instead.
Modified:
trunk/gui/interface.c
trunk/gui/ui/gtk/equalizer.c
Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c Wed Jun 29 13:21:09 2011 (r33776)
+++ trunk/gui/interface.c Wed Jun 29 13:35:58 2011 (r33777)
@@ -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 @@ int guiGetEvent(int type, void *arg)
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 @@ void *gtkSet(int cmd, float fparam, void
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);
Modified: trunk/gui/ui/gtk/equalizer.c
==============================================================================
--- trunk/gui/ui/gtk/equalizer.c Wed Jun 29 13:21:09 2011 (r33776)
+++ trunk/gui/ui/gtk/equalizer.c Wed Jun 29 13:35:58 2011 (r33777)
@@ -31,6 +31,7 @@
#include "gui/cfg.h"
#include "help_mp.h"
#include "libaf/equalizer.h"
+#include "libavutil/common.h"
#include "libvo/video_out.h"
#include "stream/stream.h"
#include "libmpdemux/demuxer.h"
@@ -255,8 +256,8 @@ static void eqSelectChannelsListRow( Gtk
if ( Channel == -1 )
{
int i,j; equalizer_t eq;
- for ( i=1;i<6;i++ )
- for ( j=0;j<10;j++ )
+ for ( i=1;i<FF_ARRAY_ELEMS(gtkEquChannels);i++ )
+ for ( j=0;j<FF_ARRAY_ELEMS(*gtkEquChannels);j++ )
{ eq.band=j; eq.channel=i; eq.gain=gtkEquChannels[0][j]; gtkSet( gtkSetEqualizer,0,&eq ); }
}
}
More information about the MPlayer-cvslog
mailing list