summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoracki2 <acki2@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-13 22:11:08 +0000
committeracki2 <acki2@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-13 22:11:08 +0000
commit9953c4838b9dc5140983b35b72e06761b3ce99af (patch)
treeeee7da7651a5fb1e3174d9b4dc2440dcb6784997
parent7efa446f9763843b15a3d162afdc66b24ccdcc2b (diff)
downloadmpv-9953c4838b9dc5140983b35b72e06761b3ce99af.tar.bz2
mpv-9953c4838b9dc5140983b35b72e06761b3ce99af.tar.xz
- fixed bug with depth and mpg when current bpp of XServer was != 32
- when -bpp is selected, I accept only query_modes() for THIS particular depth (if it's supported by hardware) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@396 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libvo/vo_dga.c44
1 files changed, 30 insertions, 14 deletions
diff --git a/libvo/vo_dga.c b/libvo/vo_dga.c
index fa2af226aa..f1dacc39e1 100644
--- a/libvo/vo_dga.c
+++ b/libvo/vo_dga.c
@@ -23,11 +23,10 @@
* - works only on x86 architectures
*
* $Log$
- * Revision 1.11 2001/04/13 18:49:59 acki2
- * - completely rewrote depth switching
- * - support for -bpp
- * (needs at least mplayer.c 1.53 and cfg-mplayer.h 1.18 and latest stuff from
- * libvo to work)
+ * Revision 1.12 2001/04/13 22:11:08 acki2
+ * - fixed bug with depth and mpg when current bpp of XServer was != 32
+ * - when -bpp is selected, I accept only query_modes() for THIS particular depth
+ * (if it's supported by hardware)
*
* Revision 1.10 2001/04/01 22:01:28 acki2
* - still more debug output to be able to fix 15/16 bpp problem
@@ -154,6 +153,18 @@ int vd_ModeEqual(int depth, int bitspp,
}
+int vd_ValidateMode( int mplayer_depth){
+ int i;
+ if(mplayer_depth == 0)return 0;
+ for(i=1; i<vo_dga_mode_num; i++){
+ if(vo_dga_modes[i].vdm_mplayer_depth == mplayer_depth ){
+ vo_dga_modes[i].vdm_supported = 1;
+ return i;
+ }
+ }
+ return 0;
+}
+
int vd_ModeValid( int mplayer_depth){
int i;
if(mplayer_depth == 0)return 0;
@@ -361,12 +372,12 @@ static uint32_t query_format( uint32_t format )
vd_printf(VD_ERR, "vo_dga: Can't open display!\n");
return 0;
}
-
- vo_dga_XServer_mode = vd_EnableMode( DefaultDepth(qdisp, DefaultScreen(qdisp)),
- BitmapUnit(qdisp),
- DefaultVisual(qdisp, DefaultScreen(qdisp))->red_mask,
- DefaultVisual(qdisp, DefaultScreen(qdisp))->green_mask,
- DefaultVisual(qdisp, DefaultScreen(qdisp))->blue_mask);
+ if( !vo_init() ){
+ vd_printf(VD_ERR, "vo_dga: vo_init() failed!\n");
+ return 1;
+ }
+ vo_dga_XServer_mode = vd_ValidateMode(vo_depthonscreen);
+
if(vo_dga_XServer_mode ==0){
#ifndef HAVE_DGA2
vd_printf(VD_ERR, "vo_dga: Your X-Server is not running in a ");
@@ -388,7 +399,7 @@ static uint32_t query_format( uint32_t format )
modelines[i].redMask,
modelines[i].greenMask,
modelines[i].blueMask,
- modelines[i].viewportWidth,
+ modelines[i].viewportWidth,
modelines[i].viewportHeight);
vd_EnableMode(
modelines[i].depth,
@@ -406,7 +417,12 @@ static uint32_t query_format( uint32_t format )
for(i=0; i<vo_dga_mode_num; i++){
if(vo_dga_modes[i].vdm_supported != 0){
- vd_printf(VD_INFO, "vo_dga: Supporting mode: %s\n", vd_GetModeString(i));
+ vd_printf(VD_INFO, "vo_dga: Supporting mode: %s", vd_GetModeString(i));
+ if(vo_dbpp && vo_dbpp != vo_dga_modes[i].vdm_mplayer_depth){
+ vo_dga_modes[i].vdm_supported = 0;
+ vd_printf(VD_INFO, " ...disabled by -bpp %d", vo_dbpp );
+ }
+ vd_printf(VD_INFO, "\n");
}
}
}
@@ -435,11 +451,11 @@ uninit(void)
XUngrabPointer (vo_dga_dpy, CurrentTime);
XUngrabKeyboard (vo_dga_dpy, CurrentTime);
#ifdef HAVE_DGA2
+ XDGACloseFramebuffer(vo_dga_dpy, XDefaultScreen(vo_dga_dpy));
dgadevice = XDGASetMode(vo_dga_dpy, XDefaultScreen(vo_dga_dpy), 0);
if(dgadevice != NULL){
XFree(dgadevice);
}
- XDGACloseFramebuffer(vo_dga_dpy, XDefaultScreen(vo_dga_dpy));
#else
XF86DGADirectVideo (vo_dga_dpy, XDefaultScreen(vo_dga_dpy), 0);
// first disable DirectVideo and then switch mode back!