summaryrefslogtreecommitdiffstats
path: root/libvo/mga_common.c
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-07-19 20:51:48 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-07-19 20:51:48 +0000
commitd05326c4bc7d26fbcf1c52a94f900a704026fc2a (patch)
tree90b1b5ee08f6805f7c6487c2ccc66db7ad92dbb9 /libvo/mga_common.c
parentbcba526d135c6fcab681212569f440877f4c50ec (diff)
downloadmpv-d05326c4bc7d26fbcf1c52a94f900a704026fc2a.tar.bz2
mpv-d05326c4bc7d26fbcf1c52a94f900a704026fc2a.tar.xz
- fix audio equalizer
- rewrite video equalizer handling (i teszted with mga g400 [x]mga,xv,xvidix and radeon xv,xvidix ) - fix some small gtk bug - i dunno, i don't remember ... :) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6756 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/mga_common.c')
-rw-r--r--libvo/mga_common.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/libvo/mga_common.c b/libvo/mga_common.c
index 7f656bd769..d96eee233c 100644
--- a/libvo/mga_common.c
+++ b/libvo/mga_common.c
@@ -37,9 +37,21 @@ static int mga_set_video_eq( const vidix_video_eq_t *info)
uint32_t luma;
float factor = 256.0 / 2000;
-
- luma = ((int)(info->brightness * factor) << 16) +
- ((int)(info->contrast * factor) & 0xFFFF);
+ static int prev_br = 0;
+ static int prev_c = 0;
+
+ if ( info->cap & VEQ_CAP_BRIGHTNESS )
+ {
+ prev_br=info->brightness;
+ if ( prev_br == 1000 ) prev_br=999; // i dunno why needed this line -- Pontscho
+ }
+ if ( info->cap & VEQ_CAP_CONTRAST )
+ {
+ prev_c=info->contrast;
+ if ( prev_c == 1000 ) prev_c=999; // i dunno why needed this line -- Pontscho
+ }
+
+ luma = ((int)(prev_br * factor) << 16) + ((int)(prev_c * factor) & 0xFFFF);
if (ioctl(f,MGA_VID_SET_LUMA,luma)) {
perror("Error in mga_vid_config ioctl()");
printf("Could not set luma values in the kernel module!\n");