removed saver_on, saver_off calls, they are already in x11_common.c
[mplayer.git] / libvo / vo_xvmc.c
index 939f263..3a620ce 100644 (file)
@@ -545,12 +545,12 @@ static uint32_t vm_height;
 
    if(surface_render==NULL)
       surface_render=malloc(MAX_SURFACES*sizeof(xvmc_render_state_t));//easy mem debug
 
    if(surface_render==NULL)
       surface_render=malloc(MAX_SURFACES*sizeof(xvmc_render_state_t));//easy mem debug
+   memset(surface_render,0,MAX_SURFACES*sizeof(xvmc_render_state_t));
 
    for(i=0; i<MAX_SURFACES; i++){
       rez=XvMCCreateSurface(mDisplay,&ctx,&surface_array[i]);
       if( rez != Success )
         break;
 
    for(i=0; i<MAX_SURFACES; i++){
       rez=XvMCCreateSurface(mDisplay,&ctx,&surface_array[i]);
       if( rez != Success )
         break;
-      memset(&surface_render[i],0,sizeof(xvmc_render_state_t));
       surface_render[i].magic = MP_XVMC_RENDER_MAGIC;
       surface_render[i].data_blocks = data_blocks.blocks;
       surface_render[i].mv_blocks = mv_blocks.macro_blocks;
       surface_render[i].magic = MP_XVMC_RENDER_MAGIC;
       surface_render[i].data_blocks = data_blocks.blocks;
       surface_render[i].mv_blocks = mv_blocks.macro_blocks;
@@ -595,23 +595,22 @@ static uint32_t vm_height;
       if(num_subpic != 0 && xvfmv != NULL){
          if(verbose > 3){//Print All subpicture types for debug
             for(s=0;s<num_subpic;s++)
       if(num_subpic != 0 && xvfmv != NULL){
          if(verbose > 3){//Print All subpicture types for debug
             for(s=0;s<num_subpic;s++)
-               printf("    Subpicture id 0x%08X\n",xvfmv[s].id);
+               print_xvimage_format_values(&xvfmv[s]);
          }
 
          }
 
-         if(verbose > 0)
          for(s=0;s<num_subpic;s++){
          for(s=0;s<num_subpic;s++){
-            for(k=0;osd_render[k].draw_func_ptr!=NULL;k++)
-
-            if(xvfmv[s].id == osd_render[k].id)
-            {  
-               init_osd_fnc  = osd_render[k].init_func_ptr;
-               draw_osd_fnc  = osd_render[k].draw_func_ptr;
-               clear_osd_fnc = osd_render[k].clear_func_ptr;
-
-               subpicture_mode = BLEND_SUBPICTURE;
-               subpicture_info = xvfmv[s];
-               print_xvimage_format_values(&subpicture_info);
-               goto found_subpic;
+            for(k=0;osd_render[k].draw_func_ptr!=NULL;k++){
+               if(xvfmv[s].id == osd_render[k].id)
+               {  
+                  init_osd_fnc  = osd_render[k].init_func_ptr;
+                  draw_osd_fnc  = osd_render[k].draw_func_ptr;
+                  clear_osd_fnc = osd_render[k].clear_func_ptr;
+
+                  subpicture_mode = BLEND_SUBPICTURE;
+                  subpicture_info = xvfmv[s];
+                  printf("    Subpicture id 0x%08X\n",subpicture_info.id);
+                  goto found_subpic;
+               }
             }
          }
 found_subpic:
             }
          }
 found_subpic:
@@ -793,7 +792,8 @@ found_subpic:
 
    mp_msg(MSGT_VO,MSGL_V, "[xvmc] dx: %d dy: %d dw: %d dh: %d\n",drwX,drwY,vo_dwidth,vo_dheight );
 
 
    mp_msg(MSGT_VO,MSGL_V, "[xvmc] dx: %d dy: %d dw: %d dh: %d\n",drwX,drwY,vo_dwidth,vo_dheight );
 
-   saver_off(mDisplay);  // turning off screen saver
+   if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
+
 //end vo_xv
 
    /* store image dimesions for displaying */
 //end vo_xv
 
    /* store image dimesions for displaying */
@@ -1186,6 +1186,7 @@ int i;
                     surface_render[i].state); 
       }
 
                     surface_render[i].state); 
       }
 
+      memset(surface_render,0,MAX_SURFACES*sizeof(xvmc_render_state_t));//for debuging
       free(surface_render);surface_render=NULL;
 
       XvMCDestroyContext(mDisplay,&ctx);
       free(surface_render);surface_render=NULL;
 
       XvMCDestroyContext(mDisplay,&ctx);
@@ -1206,7 +1207,6 @@ static void uninit(void){
    if( verbose > 3 ) printf("vo_xvmc: uninit called\n");
    xvmc_free();
  //from vo_xv
    if( verbose > 3 ) printf("vo_xvmc: uninit called\n");
    xvmc_free();
  //from vo_xv
-   saver_on(mDisplay);
    vo_vm_close(mDisplay);
    vo_x11_uninit();
 }
    vo_vm_close(mDisplay);
    vo_x11_uninit();
 }
@@ -1408,6 +1408,9 @@ static uint32_t control(uint32_t request, void *data, ... )
       //vo_xv
       case VOCTRL_GUISUPPORT:
          return VO_TRUE;
       //vo_xv
       case VOCTRL_GUISUPPORT:
          return VO_TRUE;
+      case VOCTRL_ONTOP:
+         vo_x11_ontop();
+        return VO_TRUE;
       case VOCTRL_FULLSCREEN:
          vo_x11_fullscreen();
       case VOCTRL_GET_PANSCAN:
       case VOCTRL_FULLSCREEN:
          vo_x11_fullscreen();
       case VOCTRL_GET_PANSCAN: