[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[484] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2012-11-29 11:31:56
|
Revision: 484 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=484&view=rev Author: nickols_k Date: 2012-11-29 11:31:45 +0000 (Thu, 29 Nov 2012) Log Message: ----------- cleanups + segfault-- Modified Paths: -------------- mplayerxp/libvo/video_out.cpp mplayerxp/libvo/x11_system.h mplayerxp/postproc/af.h mplayerxp/postproc/af_crystality.cpp mplayerxp/postproc/af_delay.cpp mplayerxp/postproc/af_echo3d.cpp mplayerxp/postproc/af_equalizer.cpp mplayerxp/postproc/af_pan.cpp mplayerxp/postproc/af_volnorm.cpp mplayerxp/postproc/af_volume.cpp Modified: mplayerxp/libvo/video_out.cpp =================================================================== --- mplayerxp/libvo/video_out.cpp 2012-11-29 10:25:47 UTC (rev 483) +++ mplayerxp/libvo/video_out.cpp 2012-11-29 11:31:45 UTC (rev 484) @@ -194,7 +194,6 @@ priv.vo_iface=priv.video_out->query_interface(subdev); } if(drv_name) delete drv_name; - if(subdev) delete subdev; return priv.vo_iface?MPXP_Ok:MPXP_False; } Modified: mplayerxp/libvo/x11_system.h =================================================================== --- mplayerxp/libvo/x11_system.h 2012-11-29 10:25:47 UTC (rev 483) +++ mplayerxp/libvo/x11_system.h 2012-11-29 11:31:45 UTC (rev 484) @@ -1,8 +1,6 @@ #ifndef X11_COMMON_H #define X11_COMMON_H -#ifdef HAVE_X11 - #include <X11/Xlib.h> #include <X11/Xutil.h> #ifdef HAVE_SHM @@ -163,7 +161,7 @@ GLXContext ctx; XVisualInfo* vis; }; -#endif +#endif // HAVE_OPENGL + } //namespace mpxp -#endif #endif \ No newline at end of file Modified: mplayerxp/postproc/af.h =================================================================== --- mplayerxp/postproc/af.h 2012-11-29 10:25:47 UTC (rev 483) +++ mplayerxp/postproc/af.h 2012-11-29 11:31:45 UTC (rev 484) @@ -185,30 +185,18 @@ /* print out configuration of filter's chain */ extern void af_showconf(af_instance_t *first); -#ifndef __cplusplus -/* Some other useful macro definitions*/ -#ifndef min -#define min(a,b)(((a)>(b))?(b):(a)) -#endif +template <class T> const T& clamp ( const T& a, const T& min, const T& max ) { + return (a>max)?max:((a<min)?min:a); +} -#ifndef max -#define max(a,b)(((a)>(b))?(a):(b)) -#endif +template <class T> int sign ( const T& a ) { + return (a>0)?1:-1; +} -#endif +template <class T> const T& lrnd ( const T& a, const T& b ) { + return a>=0.0?a+0.5:a-0.5; +} -#ifndef clamp -#define clamp(a,min,max) (((a)>(max))?(max):(((a)<(min))?(min):(a))) -#endif +#endif /* __AF_H__ */ -#ifndef sign -#define sign(a) (((a)>0)?(1):(-1)) -#endif -#ifndef lrnd -#define lrnd(a,b) ((b)((a)>=0.0?(a)+0.5:(a)-0.5)) -#endif - -#endif /* __aop_h__ */ - - Modified: mplayerxp/postproc/af_crystality.cpp =================================================================== --- mplayerxp/postproc/af_crystality.cpp 2012-11-29 10:25:47 UTC (rev 483) +++ mplayerxp/postproc/af_crystality.cpp 2012-11-29 11:31:45 UTC (rev 484) @@ -71,7 +71,7 @@ #include "libmpdemux/demuxer.h" #include "libmpdemux/stheader.h" -#define SAMPLE_MAX 1. +#define SAMPLE_MAX 1.0f //#define SAMPLE_MAX 1.0 /* for float32 */ @@ -388,11 +388,11 @@ inline float __FASTCALL__ calc_scalefactor(float a, float e){ float x; - a=clamp(a,0,SAMPLE_MAX/4); - e=clamp(e,0,SAMPLE_MAX/4); + a=clamp(a,0.f,SAMPLE_MAX/4); + e=clamp(e,0.f,SAMPLE_MAX/4); // return (e + a) /2; x = ((e+500/SAMPLE_MAX) * 4096 )/ (a + 300/SAMPLE_MAX) + e; - return clamp(x,0,SAMPLE_MAX/2); + return clamp(x,0.f,SAMPLE_MAX/2); } static struct Interpolation bandext_energy; Modified: mplayerxp/postproc/af_delay.cpp =================================================================== --- mplayerxp/postproc/af_delay.cpp 2012-11-29 10:25:47 UTC (rev 483) +++ mplayerxp/postproc/af_delay.cpp 2012-11-29 11:31:45 UTC (rev 484) @@ -53,7 +53,7 @@ s->ri = 0; for(i=0;i<AF_NCH;i++){ MSG_DBG2("[delay] Channel %i delayed by %0.3fms\n", - i,clamp(s->d[i],0.0,1000.0)); + i,clamp(s->d[i],0.0f,1000.0f)); MSG_DBG2("[delay] Channel %i delayed by %i samples\n", i,s->wi[i]); } Modified: mplayerxp/postproc/af_echo3d.cpp =================================================================== --- mplayerxp/postproc/af_echo3d.cpp 2012-11-29 10:25:47 UTC (rev 483) +++ mplayerxp/postproc/af_echo3d.cpp 2012-11-29 11:31:45 UTC (rev 484) @@ -142,8 +142,8 @@ s->left0p = left[0]; s->right0p = right[0]; // ************ store sample ********** - outptr[0] = clamp(_left,INT_MIN,INT_MAX); - outptr[1] = clamp(_right,INT_MIN,INT_MAX); + outptr[0] = clamp(_left,float(INT_MIN),float(INT_MAX)); + outptr[1] = clamp(_right,float(INT_MIN),float(INT_MAX)); inptr += 2; outptr += 2; } Modified: mplayerxp/postproc/af_equalizer.cpp =================================================================== --- mplayerxp/postproc/af_equalizer.cpp 2012-11-29 10:25:47 UTC (rev 483) +++ mplayerxp/postproc/af_equalizer.cpp 2012-11-29 11:31:45 UTC (rev 484) @@ -50,8 +50,8 @@ #define CF {31.25,62.5,125,250,500,1000,2000,4000,8000,16000} // Maximum and minimum gain for the bands -#define G_MAX +12.0 -#define G_MIN -12.0 +#define G_MAX +12.0f +#define G_MIN -12.0f // Data for specific instances of this filter typedef struct af_equalizer_s Modified: mplayerxp/postproc/af_pan.cpp =================================================================== --- mplayerxp/postproc/af_pan.cpp 2012-11-29 10:25:47 UTC (rev 483) +++ mplayerxp/postproc/af_pan.cpp 2012-11-29 11:31:45 UTC (rev 484) @@ -51,7 +51,7 @@ j = 0; k = 0; while((*cp == ':') && (k < AF_NCH)){ sscanf(cp, ":%f%n" , &s->level[k][j], &n); - s->level[k][j] = clamp(s->level[k][j],0.0,1.0); + s->level[k][j] = clamp(s->level[k][j],0.0f,1.0f); MSG_V("[pan] Pan level from channel %i to" " channel %i = %f\n",j,k,s->level[k][j]); cp =&cp[n]; @@ -69,7 +69,7 @@ int ch = ce->ch; float* level = reinterpret_cast<float*>(ce->arg); for(i=0;i<AF_NCH;i++) - s->level[ch][i] = clamp(level[i],0.0,1.0); + s->level[ch][i] = clamp(level[i],0.0f,1.0f); return MPXP_Ok; } case AF_CONTROL_PAN_LEVEL | AF_CONTROL_GET:{ Modified: mplayerxp/postproc/af_volnorm.cpp =================================================================== --- mplayerxp/postproc/af_volnorm.cpp 2012-11-29 10:25:47 UTC (rev 483) +++ mplayerxp/postproc/af_volnorm.cpp 2012-11-29 11:31:45 UTC (rev 484) @@ -40,8 +40,8 @@ // mul is the value by which the samples are scaled // and has to be in [MUL_MIN, MUL_MAX] #define MUL_INIT 1.0 -#define MUL_MIN 0.1 -#define MUL_MAX 5.0 +#define MUL_MIN 0.1f +#define MUL_MAX 5.0f // "Ideal" level #define MID_S16 (SHRT_MAX * 0.25) #define MID_FLOAT (INT_MAX * 0.25) Modified: mplayerxp/postproc/af_volume.cpp =================================================================== --- mplayerxp/postproc/af_volume.cpp 2012-11-29 10:25:47 UTC (rev 483) +++ mplayerxp/postproc/af_volume.cpp 2012-11-29 11:31:45 UTC (rev 484) @@ -186,7 +186,7 @@ else if(x <= -M_PI/2) x = -1.0; else x = sin(x); } else {// Hard clipping - x=clamp(x,-1.0,1.0); + x=clamp(x,-1.0f,1.0f); } _out[i] = x; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |