--- a/src/video_out/video_out_xxmc.c
+++ b/src/video_out/video_out_xxmc.c
@@ -4,7 +4,7 @@
  *
  * This file is part of xine, a free video player.
  *
- * xine is free software; you can redistribute it and/or modify it 
+ * xine is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
@@ -40,7 +40,7 @@
 
 
 static int gX11Fail;
-static void xxmc_frame_updates(xxmc_driver_t *driver, xxmc_frame_t *frame, 
+static void xxmc_frame_updates(xxmc_driver_t *driver, xxmc_frame_t *frame,
 			       int init_macroblocks);
 static void dispose_ximage (xxmc_driver_t *this, XShmSegmentInfo *shminfo,
 			    XvImage *myimage);
@@ -69,7 +69,7 @@
  * Additional thread safety, since the plugin may decide to destroy a context
  * while it's surfaces are still active in the video-out loop.
  * When / If XvMC libs are reasonably thread-safe, the locks can be made
- * more efficient by allowing multiple threads in that do not destroy 
+ * more efficient by allowing multiple threads in that do not destroy
  * the context or surfaces that may be active in other threads.
  */
 
@@ -92,7 +92,7 @@
 #ifdef XVMC_THREAD_SAFE
   c->num_readers++;
   pthread_mutex_unlock(&c->mutex);
-#endif 
+#endif
 }
 
 void xvmc_context_reader_unlock(context_lock_t *c)
@@ -103,9 +103,9 @@
     if (--(c->num_readers) == 0) {
       pthread_cond_broadcast(&c->cond);
     }
-  } 
+  }
 #endif
-  pthread_mutex_unlock(&c->mutex); 
+  pthread_mutex_unlock(&c->mutex);
 }
 
 static void xvmc_context_writer_lock(context_lock_t *c)
@@ -115,7 +115,7 @@
   while(c->num_readers) {
     pthread_cond_wait(&c->cond, &c->mutex);
   }
-#endif 
+#endif
 }
 
 static void xvmc_context_writer_unlock(context_lock_t *c)
@@ -131,34 +131,34 @@
 
 
 
-static void xxmc_xvmc_dump_surfaces(xxmc_driver_t *this ) 
+static void xxmc_xvmc_dump_surfaces(xxmc_driver_t *this )
 {
   int
     i;
   xvmc_surface_handler_t *handler = &this->xvmc_surf_handler;
 
   for (i=0; i<XVMC_MAX_SURFACES; ++i) {
-    xprintf(this->xine, XINE_VERBOSITY_DEBUG, "%d %d;",handler->surfInUse[i],  
+    xprintf(this->xine, XINE_VERBOSITY_DEBUG, "%d %d;",handler->surfInUse[i],
 	    handler->surfValid[i]);
   }
-  xprintf(this->xine, XINE_VERBOSITY_DEBUG, "\n"); 
-}
-
-static void xxmc_xvmc_dump_subpictures(xxmc_driver_t *this) 
+  xprintf(this->xine, XINE_VERBOSITY_DEBUG, "\n");
+}
+
+static void xxmc_xvmc_dump_subpictures(xxmc_driver_t *this)
 {
   int
     i;
   xvmc_surface_handler_t *handler = &this->xvmc_surf_handler;
 
   for (i=0; i<XVMC_MAX_SUBPICTURES; ++i) {
-    xprintf(this->xine, XINE_VERBOSITY_DEBUG, "%d %d;",handler->subInUse[i],  
+    xprintf(this->xine, XINE_VERBOSITY_DEBUG, "%d %d;",handler->subInUse[i],
 	    handler->subValid[i]);
   }
-  xprintf(this->xine, XINE_VERBOSITY_DEBUG, "\n"); 
-}
-
-
-static void xxmc_xvmc_surface_handler_construct(xxmc_driver_t *this) 
+  xprintf(this->xine, XINE_VERBOSITY_DEBUG, "\n");
+}
+
+
+static void xxmc_xvmc_surface_handler_construct(xxmc_driver_t *this)
 {
   xvmc_surface_handler_t *handler = &this->xvmc_surf_handler;
 
@@ -208,11 +208,11 @@
   }
   pthread_mutex_unlock(&handler->mutex);
 }
-    
-static XvMCSurface *xxmc_xvmc_alloc_surface(xxmc_driver_t *this, 
+
+static XvMCSurface *xxmc_xvmc_alloc_surface(xxmc_driver_t *this,
 					    XvMCContext *context)
 {
-  xvmc_surface_handler_t *handler = &this->xvmc_surf_handler;  
+  xvmc_surface_handler_t *handler = &this->xvmc_surf_handler;
   int i;
 
   pthread_mutex_lock(&handler->mutex);
@@ -228,7 +228,7 @@
   for (i=0; i<XVMC_MAX_SURFACES; ++i) {
     if (!handler->surfInUse[i]) {
       XVMCLOCKDISPLAY( this->display );
-      if (Success != XvMCCreateSurface( this->display, context, 
+      if (Success != XvMCCreateSurface( this->display, context,
 					handler->surfaces + i)) {
 	XVMCUNLOCKDISPLAY( this->display );
 	pthread_mutex_unlock(&handler->mutex);
@@ -247,13 +247,13 @@
   return NULL;
 }
 
-static void xxmc_xvmc_free_surface(xxmc_driver_t *this, XvMCSurface *surf) 
+static void xxmc_xvmc_free_surface(xxmc_driver_t *this, XvMCSurface *surf)
 {
   xvmc_surface_handler_t *handler = &this->xvmc_surf_handler;
   unsigned
     index = surf - handler->surfaces;
 
-  if (index >= XVMC_MAX_SURFACES) return; 
+  if (index >= XVMC_MAX_SURFACES) return;
   pthread_mutex_lock(&handler->mutex);
   xprintf (this->xine, XINE_VERBOSITY_DEBUG,
 	   LOG_MODULE ": Disposing of surface %d\n",index);
@@ -277,7 +277,7 @@
 }
 
 static XvMCSubpicture *xxmc_xvmc_alloc_subpicture
-                         (xxmc_driver_t *this, 
+                         (xxmc_driver_t *this,
 			  XvMCContext *context, unsigned short width,
 			  unsigned short height, int xvimage_id)
 {
@@ -290,7 +290,7 @@
   for (i=0; i<XVMC_MAX_SUBPICTURES; ++i) {
     if (handler->subValid[i] && !handler->subInUse[i]) {
       XVMCLOCKDISPLAY( this->display );
-      if (XvMCGetSubpictureStatus( this->display, handler->subpictures + i, 
+      if (XvMCGetSubpictureStatus( this->display, handler->subpictures + i,
 				   &status)) {
 	XVMCUNLOCKDISPLAY( this->display );
 	continue;
@@ -307,7 +307,7 @@
   for (i=0; i<XVMC_MAX_SUBPICTURES; ++i) {
     if (!handler->subInUse[i]) {
       XVMCLOCKDISPLAY( this->display );
-      if (Success != XvMCCreateSubpicture( this->display, context, 
+      if (Success != XvMCCreateSubpicture( this->display, context,
 					   handler->subpictures + i,
 					   width, height, xvimage_id)) {
 	XVMCUNLOCKDISPLAY( this->display );
@@ -327,14 +327,14 @@
   return NULL;
 }
 
-static void xxmc_xvmc_free_subpicture(xxmc_driver_t *this, XvMCSubpicture *sub) 
+static void xxmc_xvmc_free_subpicture(xxmc_driver_t *this, XvMCSubpicture *sub)
 {
 
   xvmc_surface_handler_t *handler = &this->xvmc_surf_handler;
   unsigned
     index = sub - handler->subpictures;
 
-  if (index >= XVMC_MAX_SUBPICTURES) return; 
+  if (index >= XVMC_MAX_SUBPICTURES) return;
   pthread_mutex_lock(&handler->mutex);
   xprintf (this->xine, XINE_VERBOSITY_DEBUG,
 	   LOG_MODULE ": Disposing of subpicture %d\n",index);
@@ -346,7 +346,7 @@
 
 /*
  * Callback used by decoder to check that surfaces are still valid,
- * and to lock the context so that it won't get destroyed during 
+ * and to lock the context so that it won't get destroyed during
  * decoding.
  */
 
@@ -356,9 +356,9 @@
 					   vo_frame_t *bw_frame,
 					   unsigned pc_type)
 {
-  xxmc_driver_t 
+  xxmc_driver_t
     *driver = (xxmc_driver_t *) cur_frame->driver;
-  xxmc_frame_t 
+  xxmc_frame_t
     *frame;
 
   xvmc_context_reader_lock( &driver->xvmc_lock );
@@ -377,7 +377,7 @@
     if (!xxmc_xvmc_surface_valid( driver, frame->xvmc_surf)) break;
     return 0;
   }
-  
+
   xvmc_context_reader_unlock( &driver->xvmc_lock );
   return -1;
 }
@@ -388,19 +388,19 @@
 
 static void xxmc_unlock_surfaces(vo_driver_t *this_gen)
 {
-  xxmc_driver_t 
+  xxmc_driver_t
     *driver = (xxmc_driver_t *) this_gen;
-  
+
   xvmc_context_reader_unlock( &driver->xvmc_lock );
 }
 
 /*
- * Callback for decoder. 
- * Check that the surface is vaid and 
+ * Callback for decoder.
+ * Check that the surface is vaid and
  * flush outstanding rendering requests on this surface.
  */
 
-static void xvmc_flush(vo_frame_t *this_gen) 
+static void xvmc_flush(vo_frame_t *this_gen)
 {
 
   xxmc_frame_t
@@ -412,7 +412,7 @@
 
   if ( ! xxmc_xvmc_surface_valid( driver, frame->xvmc_surf)) {
     frame->xxmc_data.result = 128;
-    xvmc_context_reader_unlock( &driver->xvmc_lock );    
+    xvmc_context_reader_unlock( &driver->xvmc_lock );
     return;
   }
 
@@ -432,10 +432,10 @@
  * using a call to XvMCBlendSubpicture2 with a blank subpicture.
  */
 
-static void xxmc_duplicate_frame_data(vo_frame_t *this_gen, 
-				      vo_frame_t *original) 
-{
-  xxmc_frame_t *this = (xxmc_frame_t *) this_gen, 
+static void xxmc_duplicate_frame_data(vo_frame_t *this_gen,
+				      vo_frame_t *original)
+{
+  xxmc_frame_t *this = (xxmc_frame_t *) this_gen,
     *orig = (xxmc_frame_t *) original;
   xxmc_driver_t *driver = (xxmc_driver_t *) this_gen->driver;
   xine_t *xine = driver->xine;
@@ -450,26 +450,26 @@
   if (!xxmc_xvmc_surface_valid(driver,orig->xvmc_surf)) {
     xvmc_context_writer_unlock( &driver->xvmc_lock );
     return;
-  }		
+  }
   this->xxmc_data = *xxmc;
   this->xxmc_data.xvmc.vo_frame = &this->vo_frame;
   this->width = original->width;
   this->height = original->height;
   this->format = original->format;
   this->ratio = original->ratio;
-  
-  xxmc_frame_updates(driver,this,0); 
+
+  xxmc_frame_updates(driver,this,0);
 
   /*
-   * Allocate a dummy subpicture and copy using 
-   * XvMCBlendsubpicture2. VLD implementations can do blending with a 
+   * Allocate a dummy subpicture and copy using
+   * XvMCBlendsubpicture2. VLD implementations can do blending with a
    * NULL subpicture. Use that if possible.
    */
 
   need_dummy = (xxmc->acceleration != XINE_XVMC_ACCEL_VLD);
   tmp = NULL;
   if (need_dummy) {
-    tmp = xxmc_xvmc_alloc_subpicture( driver, &driver->context, 
+    tmp = xxmc_xvmc_alloc_subpicture( driver, &driver->context,
 				      this->width, this->height,
 				      driver->xvmc_cap
 				      [driver->xvmc_cur_cap].subPicType.id);
@@ -478,20 +478,20 @@
     XVMCLOCKDISPLAY( driver->display );
     if (tmp) XvMCClearSubpicture(driver->display, tmp , 0,0, this->width,
 				 this->height, 0);
-    if (Success == XvMCBlendSubpicture2( driver->display, orig->xvmc_surf, 
+    if (Success == XvMCBlendSubpicture2( driver->display, orig->xvmc_surf,
 					 this->xvmc_surf, tmp,
-					 0,0,this->width, this->height, 
+					 0,0,this->width, this->height,
 					 0,0,this->width, this->height)) {
       this->xxmc_data.decoded = 1;
     }
     XVMCUNLOCKDISPLAY( driver->display );
     if (tmp) xxmc_xvmc_free_subpicture( driver, tmp);
   }
-  
+
   xvmc_context_writer_unlock( &driver->xvmc_lock );
   xprintf(xine, XINE_VERBOSITY_DEBUG, "Duplicated XvMC frame %d %d.\n",
 	  this->width,this->height);
-}   
+}
 
 static uint32_t xxmc_get_capabilities (vo_driver_t *this_gen) {
   xxmc_driver_t *this = (xxmc_driver_t *) this_gen;
@@ -500,7 +500,7 @@
 }
 
 
-static void xxmc_frame_field (vo_frame_t *vo_img, int which_field) 
+static void xxmc_frame_field (vo_frame_t *vo_img, int which_field)
 {
   lprintf ("xvmc_frame_field\n");
 }
@@ -545,13 +545,13 @@
  */
 
 static vo_frame_t *xxmc_alloc_frame (vo_driver_t *this_gen) {
-  xxmc_driver_t  *this = (xxmc_driver_t *) this_gen; 
+  xxmc_driver_t  *this = (xxmc_driver_t *) this_gen;
   xxmc_frame_t   *frame ;
 
   frame = calloc(1, sizeof (xxmc_frame_t));
   if (!frame)
     return NULL;
-  
+
   pthread_mutex_init (&frame->vo_frame.mutex, NULL);
   frame->xvmc_surf = NULL;
 
@@ -577,7 +577,7 @@
 
 static int HandleXError (Display *display, XErrorEvent *xevent) {
   char str [1024];
-  
+
   XGetErrorText (display, xevent->error_code, str, 1024);
   printf ("received X error event: %s\n", str);
   gX11Fail = 1;
@@ -609,7 +609,7 @@
   }
 
   switch (format) {
-  case XINE_IMGFMT_YV12: 
+  case XINE_IMGFMT_YV12:
     xv_format = this->xv_format_yv12;
     break;
   case XINE_IMGFMT_YUY2:
@@ -759,7 +759,7 @@
       XvMCDestroyMacroBlocks( driver->display, &macroblocks->macro_blocks );
       XvMCDestroyBlocks( driver->display , &macroblocks->blocks );
     }
-    
+
     xprintf(driver->xine, XINE_VERBOSITY_LOG,
 	    LOG_MODULE ": Freeing up XvMC Surfaces and subpictures.\n");
     if (driver->xvmc_palette) free(driver->xvmc_palette);
@@ -769,15 +769,15 @@
     xprintf(driver->xine, XINE_VERBOSITY_LOG,
 	    LOG_MODULE ": Freeing up XvMC Context.\n");
     XLockDisplay (driver->display);
-    if (driver->subImage) 
-      dispose_ximage(driver, &driver->subShmInfo, driver->subImage); 
+    if (driver->subImage)
+      dispose_ximage(driver, &driver->subShmInfo, driver->subImage);
     driver->subImage = NULL;
     XUnlockDisplay (driver->display);
     XVMCLOCKDISPLAY( driver->display );
     XvMCDestroyContext( driver->display, &driver->context);
     XVMCUNLOCKDISPLAY( driver->display );
     driver->contextActive = 0;
-    driver->hwSubpictures = 0; 
+    driver->hwSubpictures = 0;
     driver->xvmc_accel = 0;
   }
 }
@@ -785,7 +785,7 @@
 /*
  * Find a suitable XvMC Context according to the acceleration request
  * passed to us in the xxmc variable, and to the acceleration type
- * priority set up in this plugin. Result is returned in 
+ * priority set up in this plugin. Result is returned in
  * driver->xvmc_cur_cap.
  */
 
@@ -799,7 +799,7 @@
   request_mpeg_flags = xxmc->mpeg;
   found = 0;
   curCap = NULL;
-  
+
   for (k = 0; k < NUM_ACCEL_PRIORITY; ++k) {
     request_accel_flags = xxmc->acceleration & accel_priority[k];
     if (!request_accel_flags) continue;
@@ -833,7 +833,7 @@
   }
   driver->xvmc_accel = 0;
   return 0;
-}   
+}
 
 static int xxmc_create_context(xxmc_driver_t *driver, unsigned width, unsigned height)
 {
@@ -843,9 +843,9 @@
   xprintf(driver->xine, XINE_VERBOSITY_LOG,
 	  LOG_MODULE ": Creating new XvMC Context %d\n",curCap->type_id);
   XVMCLOCKDISPLAY( driver->display );
-  if (Success == XvMCCreateContext( driver->display, driver->xv_port, 
+  if (Success == XvMCCreateContext( driver->display, driver->xv_port,
 				    curCap->type_id, width,
-				    height, driver->context_flags, 
+				    height, driver->context_flags,
 				    &driver->context)) {
     driver->xvmc_mpeg = curCap->mpeg_flags;
     driver->xvmc_width = width;
@@ -866,26 +866,26 @@
     /*
      * Determine if we can use hardware subpictures, and in that case, set up an
      * XvImage that we can use for blending.
-     */    
+     */
     curCap = driver->xvmc_cap + driver->xvmc_cur_cap;
 
-    if ((width > curCap->sub_max_width) || 
+    if ((width > curCap->sub_max_width) ||
 	(height > curCap->sub_max_height)) return;
 
-    if ((driver->xvmc_backend_subpic = (curCap->flags & XVMC_BACKEND_SUBPICTURE))) 
+    if ((driver->xvmc_backend_subpic = (curCap->flags & XVMC_BACKEND_SUBPICTURE)))
       xprintf(driver->xine, XINE_VERBOSITY_LOG,
 	      LOG_MODULE ": Using Backend subpictures.\n");
-    
+
     if (!driver->subImage) {
       /*
        * Note: If other image formats than xx44 are to be used here, they must be
-       * translated to XINE_IMGFMT_XXX, since that is what create_ximage 
+       * translated to XINE_IMGFMT_XXX, since that is what create_ximage
        * expects.
        */
 
       XLockDisplay (driver->display);
 
-      driver->subImage = 
+      driver->subImage =
 	create_ximage(driver, &driver->subShmInfo, width, height, curCap->subPicType.id);
       XUnlockDisplay (driver->display);
       if (NULL == driver->subImage) {
@@ -895,15 +895,15 @@
       }
     }
 
-    sp = xxmc_xvmc_alloc_subpicture( driver, &driver->context, width, 
+    sp = xxmc_xvmc_alloc_subpicture( driver, &driver->context, width,
 				     height, curCap->subPicType.id);
     if (sp == NULL) return;
 
     _x_init_xx44_palette( &driver->palette, sp->num_palette_entries);
-    driver->xvmc_palette = (char *) xine_xmalloc(sp->num_palette_entries 
+    driver->xvmc_palette = (char *) xine_xmalloc(sp->num_palette_entries
 						 * sp->entry_bytes);
     xxmc_xvmc_free_subpicture( driver, sp);
-    if (driver->xvmc_palette == NULL) return; 
+    if (driver->xvmc_palette == NULL) return;
     driver->hwSubpictures = 1;
   }
 }
@@ -933,8 +933,8 @@
     xxmc->xvmc.macroblocks = (xine_macroblocks_t *)macroblocks;
 
     return 1;
-}					 
- 
+}
+
 static void xvmc_check_colorkey_properties(xxmc_driver_t *driver)
 {
   int num,i;
@@ -949,7 +949,7 @@
   driver->have_xvmc_autopaint = 0;
   if (driver->context_flags & XVMC_OVERLAID_SURFACE) {
     XVMCLOCKDISPLAY( driver->display );
-    xvmc_attributes = XvMCQueryAttributes( driver->display, 
+    xvmc_attributes = XvMCQueryAttributes( driver->display,
 					   &driver->context,
 					   &num);
     if (xvmc_attributes) {
@@ -959,7 +959,7 @@
 	  XvMCSetAttribute(driver->display, &driver->context,ap,
 			   driver->props[VO_PROP_AUTOPAINT_COLORKEY].value);
 	  driver->have_xvmc_autopaint = 1;
-	}			 
+	}
       }
     }
     XFree(xvmc_attributes);
@@ -972,16 +972,16 @@
 
 
 static int xxmc_xvmc_update_context(xxmc_driver_t *driver, xxmc_frame_t *frame,
-				    uint32_t width, uint32_t height, int frame_format_xxmc) 
+				    uint32_t width, uint32_t height, int frame_format_xxmc)
 {
   xine_xxmc_t *xxmc = &frame->xxmc_data;
 
   /*
    * Are we at all capable of doing XvMC ?
-   */ 
-
-  
-  if (driver->xvmc_cap == 0) 
+   */
+
+
+  if (driver->xvmc_cap == 0)
     return 0;
 
   xprintf(driver->xine, XINE_VERBOSITY_LOG,
@@ -992,18 +992,18 @@
 	  " mpeg: %d acceleration: %d", xxmc->mpeg, xxmc->acceleration);
   }
   xprintf(driver->xine, XINE_VERBOSITY_LOG, "\n");
-  
+
   if (frame->xvmc_surf)
     xxmc_xvmc_free_surface( driver , frame->xvmc_surf);
   frame->xvmc_surf = NULL;
 
   xxmc_dispose_context( driver );
-  
+
   if (frame_format_xxmc && xxmc_find_context( driver, xxmc, width, height )) {
     xxmc_create_context( driver, width, height);
     xvmc_check_colorkey_properties( driver );
     xxmc_setup_subpictures(driver, width, height);
-    if ((driver->xvmc_accel & 
+    if ((driver->xvmc_accel &
 	 (XINE_XVMC_ACCEL_MOCOMP | XINE_XVMC_ACCEL_IDCT))) {
       if (!xxmc_mocomp_create_macroblocks(driver, frame, 1)) {
 	printf(LOG_MODULE ": ERROR: Macroblock allocation failed\n");
@@ -1018,15 +1018,15 @@
   } else {
     printf(LOG_MODULE ": Using hardware decoding for this stream.\n");
   }
-    
+
   driver->xvmc_mpeg = xxmc->mpeg;
   driver->xvmc_width = width;
   driver->xvmc_height = height;
   return driver->contextActive;
 }
 
-static void xxmc_frame_updates(xxmc_driver_t *driver, 
-			       xxmc_frame_t *frame, 
+static void xxmc_frame_updates(xxmc_driver_t *driver,
+			       xxmc_frame_t *frame,
 			       int init_macroblocks)
 {
   xine_xxmc_t *xxmc = &frame->xxmc_data;
@@ -1047,10 +1047,10 @@
 
   /*
    * If it is NULL create a new surface.
-   */ 
+   */
 
   if (frame->xvmc_surf == NULL) {
-    if (NULL == (frame->xvmc_surf = 
+    if (NULL == (frame->xvmc_surf =
 		 xxmc_xvmc_alloc_surface( driver, &driver->context))) {
       fprintf(stderr, LOG_MODULE ": ERROR: Accelerated surface allocation failed.\n"
 	      LOG_MODULE ": You are probably out of framebuffer memory.\n"
@@ -1058,7 +1058,7 @@
       driver->xvmc_accel = 0;
       xxmc_dispose_context( driver );
       return;
-    }        
+    }
     xxmc->xvmc.macroblocks = (xine_macroblocks_t *) &driver->macroblocks;
     xxmc->xvmc.macroblocks->xvmc_accel = (driver->unsigned_intra) ?
       0 : XINE_VO_SIGNED_INTRA;
@@ -1077,7 +1077,7 @@
     xxmc->proc_xxmc_flush = xvmc_flush;
     xxmc->proc_xxmc_lock_valid = xxmc_lock_and_validate_surfaces;
     xxmc->proc_xxmc_unlock = xxmc_unlock_surfaces;
-    
+
     xxmc->xvmc.proc_macro_block = xxmc_xvmc_proc_macro_block;
     frame->vo_frame.proc_duplicate_frame_data = xxmc_duplicate_frame_data;
 #ifdef HAVE_VLDXVMC
@@ -1089,7 +1089,7 @@
   if (init_macroblocks) {
     driver->macroblocks.num_blocks = 0;
     driver->macroblocks.macroblockptr = driver->macroblocks.macroblockbaseptr;
-    driver->macroblocks.xine_mc.blockptr = 
+    driver->macroblocks.xine_mc.blockptr =
       driver->macroblocks.xine_mc.blockbaseptr;
   }
   xxmc->acceleration = driver->xvmc_accel;
@@ -1111,7 +1111,7 @@
       shminfo->shmid = -1;
     }
 
-  } 
+  }
   else {
     if (myimage->data) free(myimage->data);
     XFree (myimage);
@@ -1131,29 +1131,29 @@
   if (this->use_pitch_alignment) {
     width = (width + 7) & ~0x7;
   }
-  
+
   if ((frame->width != width)
       || (frame->height != height)
       || (frame->last_sw_format != format)) {
-    
+
     frame->last_sw_format = format;
     XLockDisplay (this->display);
-    
+
     /*
      * (re-) allocate xvimage
      */
-    
+
     if (frame->image) {
       dispose_ximage (this, &frame->shminfo, frame->image);
       frame->image = NULL;
     }
-    
+
     frame->image = create_ximage (this, &frame->shminfo, width, height, format);
-    
+
     if(format == XINE_IMGFMT_YUY2) {
       frame->vo_frame.pitches[0] = frame->image->pitches[0];
       frame->vo_frame.base[0] = frame->image->data + frame->image->offsets[0];
-    } 
+    }
     else {
       frame->vo_frame.pitches[0] = frame->image->pitches[0];
       frame->vo_frame.pitches[1] = frame->image->pitches[2];
@@ -1162,14 +1162,14 @@
       frame->vo_frame.base[1] = frame->image->data + frame->image->offsets[2];
       frame->vo_frame.base[2] = frame->image->data + frame->image->offsets[1];
     }
-    
+
     XUnlockDisplay (this->display);
   }
 
   frame->ratio = ratio;
   frame->width  = width;
   frame->height = height;
-  frame->format = format;   
+  frame->format = format;
   frame->vo_frame.format = frame->format;
 }
 
@@ -1186,7 +1186,7 @@
 
   /*
    * Same acceleration request. No need to change.
-   */ 
+   */
 
   if (last_request == new_request) return 0;
 
@@ -1205,7 +1205,7 @@
     if (new_request & accel_priority[k]) return 1;
   }
 
-  /* 
+  /*
    * Should never get here.
    */
 
@@ -1242,10 +1242,10 @@
       this->last_accel_request = xxmc->acceleration;
     }
 
-    if (this->contextActive) 
+    if (this->contextActive)
       xxmc_frame_updates(this, frame, 1);
 
-    xxmc_do_update_frame_xv(this_gen, &frame->vo_frame, width, height, ratio, 
+    xxmc_do_update_frame_xv(this_gen, &frame->vo_frame, width, height, ratio,
 			    xxmc->fallback_format, flags);
 
     if (!this->contextActive) {
@@ -1258,7 +1258,7 @@
     }
 
     xvmc_context_writer_unlock( &this->xvmc_lock);
-    
+
     if (frame_gen != &frame->vo_frame) {
       /* this is an intercepted frame, so we need to detect and propagate any
        * changes on the original vo_frame to all the intercepted frames */
@@ -1293,7 +1293,7 @@
       xxmc_xvmc_update_context(this, frame, width, height, 0);
     }
     frame->vo_frame.proc_duplicate_frame_data = NULL;
-    xxmc_do_update_frame_xv(this_gen, &frame->vo_frame, width, height, ratio, 
+    xxmc_do_update_frame_xv(this_gen, &frame->vo_frame, width, height, ratio,
 			    format, flags);
   }
 }
@@ -1301,7 +1301,7 @@
 static void xxmc_update_frame_format(vo_driver_t *this_gen,
 				     vo_frame_t *frame_gen,
 				     uint32_t width, uint32_t height,
-				     double ratio, int format, int flags) 
+				     double ratio, int format, int flags)
 {
 
   if (format != XINE_IMGFMT_XXMC) {
@@ -1319,7 +1319,7 @@
     xine_xxmc_t *xxmc = (xine_xxmc_t *)frame_gen->accel_data;
     xxmc->decoded = 0;
     xxmc->proc_xxmc_update_frame = xxmc_do_update_frame;
-    frame_gen->proc_duplicate_frame_data = xxmc_duplicate_frame_data; 
+    frame_gen->proc_duplicate_frame_data = xxmc_duplicate_frame_data;
   }
 }
 
@@ -1341,16 +1341,16 @@
 		     this->sc.border[i].w, this->sc.border[i].h);
     }
   }
-  
+
   /*
    * XvMC does not support autopainting regardless of whether there's an
-   * Xv attribute for it. However, if there is an XvMC attribute for 
-   * autopainting, we should be able to assume it is supported. 
+   * Xv attribute for it. However, if there is an XvMC attribute for
+   * autopainting, we should be able to assume it is supported.
    * That support is checked whenever a context is changed.
    */
 
-  autopainting = (this->props[VO_PROP_AUTOPAINT_COLORKEY].value == 1); 
-  if ((xvmc_active && 
+  autopainting = (this->props[VO_PROP_AUTOPAINT_COLORKEY].value == 1);
+  if ((xvmc_active &&
        (this->context_flags & XVMC_OVERLAID_SURFACE) &&
        (! this->have_xvmc_autopaint ||
 	! autopainting)) ||
@@ -1363,12 +1363,12 @@
   } else {
     ret = 0;
   }
-  
+
   if (this->xoverlay) {
     x11osd_resize (this->xoverlay, this->sc.gui_width, this->sc.gui_height);
     this->ovl_changed = 1;
   }
-  
+
   XUnlockDisplay (this->display);
   return ret;
 }
@@ -1394,11 +1394,11 @@
 }
 
 
-static void xxmc_check_xoverlay_type(xxmc_driver_t *driver, xxmc_frame_t *frame) 
+static void xxmc_check_xoverlay_type(xxmc_driver_t *driver, xxmc_frame_t *frame)
 
 {
   int
-    new_overlay_type = (frame->format == XINE_IMGFMT_XXMC) ? 
+    new_overlay_type = (frame->format == XINE_IMGFMT_XXMC) ?
     driver->xvmc_xoverlay_type : driver->xv_xoverlay_type;
   if (driver->xoverlay_type != new_overlay_type) {
     printf("Warning! Changing xoverlay\n");
@@ -1411,40 +1411,40 @@
 }
 
 
-static void xxmc_overlay_begin (vo_driver_t *this_gen, 
+static void xxmc_overlay_begin (vo_driver_t *this_gen,
 				vo_frame_t *frame_gen, int changed) {
   xxmc_driver_t  *this = (xxmc_driver_t *) this_gen;
   xxmc_frame_t *frame = (xxmc_frame_t *) frame_gen;
 
 
   this->ovl_changed += changed;
-  
+
   xvmc_context_reader_lock( &this->xvmc_lock );
-  if ((frame->format == XINE_IMGFMT_XXMC) && 
+  if ((frame->format == XINE_IMGFMT_XXMC) &&
       !xxmc_xvmc_surface_valid(this, frame->xvmc_surf)) {
     xvmc_context_reader_unlock( &this->xvmc_lock );
     return;
   }
 
   if( this->ovl_changed && this->xoverlay ) {
-    
+
     XLockDisplay (this->display);
     xxmc_check_xoverlay_type(this, frame);
-    x11osd_clear(this->xoverlay); 
+    x11osd_clear(this->xoverlay);
     XUnlockDisplay (this->display);
-  } 
-  if (this->ovl_changed && (frame->format == XINE_IMGFMT_XXMC) && 
+  }
+  if (this->ovl_changed && (frame->format == XINE_IMGFMT_XXMC) &&
       this->hwSubpictures ) {
 
     this->new_subpic = xxmc_xvmc_alloc_subpicture
-      ( this, &this->context, this->xvmc_width, 
-	this->xvmc_height, 
+      ( this, &this->context, this->xvmc_width,
+	this->xvmc_height,
 	this->xvmc_cap[this->xvmc_cur_cap].subPicType.id);
 
     if (this->new_subpic) {
       this->first_overlay = 1;
       XVMCLOCKDISPLAY( this->display );
-      XvMCClearSubpicture(this->display, this->new_subpic, 0,0, 
+      XvMCClearSubpicture(this->display, this->new_subpic, 0,0,
 			  this->xvmc_width,
 			  this->xvmc_height, 0x00);
       XVMCUNLOCKDISPLAY( this->display );
@@ -1452,22 +1452,22 @@
     }
   }
   xvmc_context_reader_unlock( &this->xvmc_lock );
-  
+
   this->alphablend_extra_data.offset_x = frame_gen->overlay_offset_x;
   this->alphablend_extra_data.offset_y = frame_gen->overlay_offset_y;
 }
 
-static void xxmc_overlay_end (vo_driver_t *this_gen, vo_frame_t *vo_img) 
+static void xxmc_overlay_end (vo_driver_t *this_gen, vo_frame_t *vo_img)
 {
   xxmc_driver_t  *this = (xxmc_driver_t *) this_gen;
   xxmc_frame_t   *frame = (xxmc_frame_t *) vo_img;
 
-  
+
   if( this->ovl_changed && this->xoverlay ) {
     XLockDisplay (this->display);
     x11osd_expose(this->xoverlay);
     XUnlockDisplay (this->display);
-  } 
+  }
   if ((frame->format == XINE_IMGFMT_XXMC) && this->hwSubpictures) {
     LOCK_AND_SURFACE_VALID( this, frame->xvmc_surf );
     if (this->ovl_changed) {
@@ -1484,7 +1484,7 @@
 			      this->reverse_nvidia_palette ? "YVU" :
 			      this->old_subpic->component_order);
 	XVMCLOCKDISPLAY( this->display );
-	XvMCSetSubpicturePalette( this->display, this->old_subpic, 
+	XvMCSetSubpicturePalette( this->display, this->old_subpic,
 				  this->xvmc_palette);
 	XvMCFlushSubpicture( this->display , this->old_subpic);
 	XvMCSyncSubpicture( this->display, this->old_subpic );
@@ -1495,14 +1495,14 @@
       XVMCLOCKDISPLAY( this->display );
       if (this->xvmc_backend_subpic ) {
 	XvMCBlendSubpicture( this->display, frame->xvmc_surf,
-			     this->old_subpic,0,0,this->xvmc_width, 
+			     this->old_subpic,0,0,this->xvmc_width,
 			     this->xvmc_height, 0, 0,
 			     this->xvmc_width, this->xvmc_height );
       } else {
-	XvMCBlendSubpicture2( this->display, frame->xvmc_surf, 
+	XvMCBlendSubpicture2( this->display, frame->xvmc_surf,
 			      frame->xvmc_surf,
-			      this->old_subpic, 0,0,this->xvmc_width, 
-			      this->xvmc_height,0,0,this->xvmc_width, 
+			      this->old_subpic, 0,0,this->xvmc_width,
+			      this->xvmc_height,0,0,this->xvmc_width,
 			      this->xvmc_height);
       }
       XVMCUNLOCKDISPLAY( this->display );
@@ -1513,8 +1513,8 @@
 }
 
 
-static void xxmc_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, 
-				vo_overlay_t *overlay) 
+static void xxmc_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen,
+				vo_overlay_t *overlay)
 {
   xxmc_driver_t  *this = (xxmc_driver_t *) this_gen;
   xxmc_frame_t   *frame = (xxmc_frame_t *) frame_gen;
@@ -1524,7 +1524,7 @@
     if( overlay->unscaled ) {
       if( this->ovl_changed && this->xoverlay ) {
         XLockDisplay (this->display);
-        x11osd_blend(this->xoverlay, overlay); 
+        x11osd_blend(this->xoverlay, overlay);
         XUnlockDisplay (this->display);
       }
     } else if (frame->format == XINE_IMGFMT_XXMC) {
@@ -1537,7 +1537,7 @@
 		   this->subImage->height);
 	    this->first_overlay = 0;
 	  }
-	  _x_blend_xx44(this->subImage->data, overlay, this->subImage->width, 
+	  _x_blend_xx44(this->subImage->data, overlay, this->subImage->width,
 		     this->subImage->height, this->subImage->width,
                      &this->alphablend_extra_data,
 		     &this->palette, (this->subImage->id == FOURCC_IA44));
@@ -1549,7 +1549,7 @@
           y1 = y0 + overlay->height;
           w = this->subImage->width;
           h = this->subImage->height;
-          
+
           x0 = (x0 < 0) ? 0 : ((x0 > w) ? w : x0);
           y0 = (y0 < 0) ? 0 : ((y0 > h) ? h : y0);
           x1 = (x1 < 0) ? 0 : ((x1 > w) ? w : x1);
@@ -1558,22 +1558,22 @@
           /* anything left after clipping? */
           if (x0 != x1 && y0 != y1) {
 	    XVMCLOCKDISPLAY( this->display );
-	    XvMCCompositeSubpicture( this->display, this->new_subpic, 
-				     this->subImage, 
+	    XvMCCompositeSubpicture( this->display, this->new_subpic,
+				     this->subImage,
 				     x0, y0, x1 - x0, y1 - y0,
 				     x0, y0);
 	    XVMCUNLOCKDISPLAY( this->display );
           }
-	  xvmc_context_reader_unlock( &this->xvmc_lock ); 
+	  xvmc_context_reader_unlock( &this->xvmc_lock );
         }
       }
-    } else {      
+    } else {
       if (frame->format == XINE_IMGFMT_YV12) {
-        _x_blend_yuv(frame->vo_frame.base, overlay, 
+        _x_blend_yuv(frame->vo_frame.base, overlay,
 		  frame->width, frame->height, frame->vo_frame.pitches,
                   &this->alphablend_extra_data);
       } else {
-	_x_blend_yuy2(frame->vo_frame.base[0], overlay, 
+	_x_blend_yuy2(frame->vo_frame.base[0], overlay,
 		   frame->width, frame->height, frame->vo_frame.pitches[0],
                    &this->alphablend_extra_data);
       }
@@ -1581,7 +1581,7 @@
   }
 }
 
-static void xxmc_add_recent_frame (xxmc_driver_t *this, xxmc_frame_t *frame) 
+static void xxmc_add_recent_frame (xxmc_driver_t *this, xxmc_frame_t *frame)
 {
   int i;
   i = VO_NUM_RECENT_FRAMES-1;
@@ -1595,11 +1595,11 @@
   this->recent_frames[0] = frame;
 }
 
-static int xxmc_redraw_needed (vo_driver_t *this_gen) 
+static int xxmc_redraw_needed (vo_driver_t *this_gen)
 {
   xxmc_driver_t  *this = (xxmc_driver_t *) this_gen;
   int           ret  = 0;
-  
+
   if( this->cur_frame ) {
 
     this->sc.delivered_height = this->cur_frame->height;
@@ -1616,8 +1616,8 @@
     if( _x_vo_scale_redraw_needed( &this->sc ) ) {
 
       xxmc_compute_output_size (this);
-      
-      xxmc_clean_output_area 
+
+      xxmc_clean_output_area
 	(this, (this->cur_frame->format == XINE_IMGFMT_XXMC));
 
       ret = 1;
@@ -1629,7 +1629,7 @@
   return ret;
 }
 
-static void xxmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) 
+static void xxmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
 {
   xxmc_driver_t  *this  = (xxmc_driver_t *) this_gen;
   xxmc_frame_t   *frame = (xxmc_frame_t *) frame_gen;
@@ -1663,7 +1663,7 @@
    * reset this flag now -- it will be set again before the next call to
    * xxmc_display_frame() as long as there is a scaled OSD active on screen.
    */
-  this->scaled_osd_active = 0; 
+  this->scaled_osd_active = 0;
 
   /*
    * queue frames (deinterlacing)
@@ -1721,7 +1721,7 @@
 		    this->sc.displayed_xoffset, this->sc.displayed_yoffset,
 		    this->sc.displayed_width, this->sc.displayed_height,
 		    this->sc.output_xoffset, this->sc.output_yoffset,
-		    this->sc.output_width, this->sc.output_height, 
+		    this->sc.output_width, this->sc.output_height,
 		    this->cur_field);
     XUnlockDisplay( this->display ); /* unblocks XINE_GUI_SEND_DRAWABLE_CHANGED from changing drawable */
     XVMCUNLOCKDISPLAY( this->display );
@@ -1757,12 +1757,12 @@
 		        this->sc.displayed_xoffset, this->sc.displayed_yoffset,
 		        this->sc.displayed_width, this->sc.displayed_height,
 		        this->sc.output_xoffset, this->sc.output_yoffset,
-		        this->sc.output_width, this->sc.output_height, 
+		        this->sc.output_width, this->sc.output_height,
 		        this->cur_field);
         XUnlockDisplay( this->display ); /* unblocks XINE_GUI_SEND_DRAWABLE_CHANGED from changing drawable */
         XVMCUNLOCKDISPLAY( this->display );
       }
-    }      
+    }
   } else {
     XLockDisplay (this->display);
     if (this->use_shm) {
@@ -1829,7 +1829,7 @@
   if (this->contextActive) {
     XVMCLOCKDISPLAY( this->display );
     XvMCSetAttribute(this->display, &this->context,
-		     property->atom, 
+		     property->atom,
 		     entry->num_value);
     XVMCUNLOCKDISPLAY( this->display );
   }
@@ -1849,7 +1849,7 @@
     if (this->contextActive) {
       XVMCLOCKDISPLAY( this->display );
       XvMCSetAttribute(this->display, &this->context,
-		       this->props[property].atom, 
+		       this->props[property].atom,
 		       value);
       XVMCUNLOCKDISPLAY( this->display );
     }
@@ -1867,7 +1867,7 @@
       this->props[property].entry->num_value = this->props[property].value;
 
     return this->props[property].value;
-  } 
+  }
   else {
     switch (property) {
 
@@ -1883,7 +1883,7 @@
 	value = XINE_VO_ASPECT_AUTO;
 
       this->props[property].value = value;
-      xprintf(this->xine, XINE_VERBOSITY_LOG, 
+      xprintf(this->xine, XINE_VERBOSITY_LOG,
 	      LOG_MODULE ": VO_PROP_ASPECT_RATIO(%d)\n", this->props[property].value);
       this->sc.user_ratio = value;
 
@@ -1897,7 +1897,7 @@
         this->props[property].value = value;
 	xprintf(this->xine, XINE_VERBOSITY_LOG,
 		LOG_MODULE ": VO_PROP_ZOOM_X = %d\n", this->props[property].value);
-	
+
 	this->sc.zoom_factor_x = (double)value / (double)XINE_VO_ZOOM_STEP;
 
 	xxmc_compute_ideal_size (this);
@@ -1942,7 +1942,7 @@
   case XINE_GUI_SEND_COMPLETION_EVENT:
     break;
 #endif
-    
+
   case XINE_GUI_SEND_EXPOSE_EVENT: {
     /* XExposeEvent * xev = (XExposeEvent *) data; */
 
@@ -1954,7 +1954,7 @@
       if ((frame->format == XINE_IMGFMT_XXMC) &&
 	  (!xxmc->decoded || !xxmc_xvmc_surface_valid(this, frame->xvmc_surf))) {
 	xvmc_context_reader_unlock( &this->xvmc_lock );
-	if (! xxmc_redraw_needed (this_gen)) 
+	if (! xxmc_redraw_needed (this_gen))
 	  xxmc_clean_output_area(this, (frame->format == XINE_IMGFMT_XXMC));
 	break;
       }
@@ -1968,8 +1968,8 @@
 			this->sc.displayed_xoffset, this->sc.displayed_yoffset,
 			this->sc.displayed_width, this->sc.displayed_height,
 			this->sc.output_xoffset, this->sc.output_yoffset,
-			this->sc.output_width, this->sc.output_height, 
-			this->cur_field); 
+			this->sc.output_width, this->sc.output_height,
+			this->cur_field);
 	XVMCUNLOCKDISPLAY( this->display );
       } else {
 	XLockDisplay (this->display);
@@ -1994,10 +1994,10 @@
       xvmc_context_reader_unlock( &this->xvmc_lock );
     }
     if(this->xoverlay)
-      x11osd_expose(this->xoverlay);	
-      
-  }
-  
+      x11osd_expose(this->xoverlay);
+
+  }
+
     break;
 
   case XINE_GUI_SEND_DRAWABLE_CHANGED:
@@ -2040,7 +2040,7 @@
   xxmc_driver_t *this = (xxmc_driver_t *) this_gen;
   int          i;
 
-  
+
   if (this->xvmc_cap) {
     xvmc_context_writer_lock( &this->xvmc_lock );
     xxmc_dispose_context( this );
@@ -2077,7 +2077,7 @@
   free_context_lock(&this->xvmc_lock);
 
   _x_alphablend_free(&this->alphablend_extra_data);
-  
+
   free (this);
 }
 
@@ -2088,7 +2088,7 @@
   int                  i;
 
   formatValues = XvListImageFormats (display, port, &formats);
-  
+
   for (i = 0; i < formats; i++)
     if ((formatValues[i].id == XINE_IMGFMT_YV12) &&
 	(! (strcmp (formatValues[i].guid, "YV12")))) {
@@ -2109,7 +2109,7 @@
   int          int_default;
   cfg_entry_t *entry;
   const char  *str_prop = attr.name;
-  
+
   if (VO_PROP_COLORKEY && (attr.max_value == ~0))
     attr.max_value = 2147483615;
 
@@ -2128,7 +2128,7 @@
    */
   if(strcmp(str_prop, "XV_AUTOPAINT_COLORKEY") == 0)
     int_default = 1;
-    
+
   if (config_name) {
     /* is this a boolean property ? */
     if ((attr.min_value == 0) && (attr.max_value == 1)) {
@@ -2145,12 +2145,12 @@
 
     entry = this->config->lookup_entry (this->config, config_name);
 
-    if((entry->num_value < this->props[property].min) || 
+    if((entry->num_value < this->props[property].min) ||
        (entry->num_value > this->props[property].max)) {
 
-      this->config->update_num(this->config, config_name, 
+      this->config->update_num(this->config, config_name,
 			       ((this->props[property].min + this->props[property].max) >> 1));
-      
+
       entry = this->config->lookup_entry (this->config, config_name);
     }
 
@@ -2158,13 +2158,13 @@
 
     xxmc_set_property (&this->vo_driver, property, entry->num_value);
 
-    
+
     if (strcmp(str_prop, "XV_COLORKEY") == 0) {
       this->use_colorkey |= 1;
       this->colorkey = entry->num_value;
     } else if(strcmp(str_prop, "XV_AUTOPAINT_COLORKEY") == 0) {
       if(entry->num_value==1)
-        this->use_colorkey |= 2;	
+        this->use_colorkey |= 2;
     }
   } else
     this->props[property].value  = int_default;
@@ -2281,13 +2281,13 @@
 }
 
 
-static void checkXvMCCap( xxmc_driver_t *this, XvPortID xv_port) 
+static void checkXvMCCap( xxmc_driver_t *this, XvPortID xv_port)
 {
   int
     numSurf,numSub,i,j;
   XvMCSurfaceInfo
     *surfaceInfo,*curInfo;
-  XvMCContext 
+  XvMCContext
     c;
   xvmc_capabilities_t
     *curCap;
@@ -2306,13 +2306,13 @@
 
   XVMCLOCKDISPLAY( this->display );
 
-  if ( !XvMCQueryExtension(this->display, &this->xvmc_eventbase, 
+  if ( !XvMCQueryExtension(this->display, &this->xvmc_eventbase,
 			   &this->xvmc_errbase)) {
     XVMCUNLOCKDISPLAY( this->display );
     xvmc_context_writer_unlock( &this->xvmc_lock );
     return;
   }
-  xprintf (this->xine, XINE_VERBOSITY_DEBUG, 
+  xprintf (this->xine, XINE_VERBOSITY_DEBUG,
 	   LOG_MODULE ": XvMC extension present.\n");
 
   surfaceInfo = XvMCListSurfaceTypes(this->display, xv_port, &numSurf);
@@ -2328,54 +2328,54 @@
   curInfo = surfaceInfo;
   curCap = this->xvmc_cap;
 
-  xprintf (this->xine, XINE_VERBOSITY_DEBUG, 
+  xprintf (this->xine, XINE_VERBOSITY_DEBUG,
 	   LOG_MODULE ": Found %d XvMC surface types\n", numSurf);
 
   for (i=0; i< numSurf; ++i) {
     curCap->mpeg_flags = 0;
     curCap->accel_flags = 0;
     if (curInfo->chroma_format == XVMC_CHROMA_FORMAT_420) {
-      curCap->mpeg_flags |= ((curInfo->mc_type & XVMC_MPEG_1) ? 
-			     XINE_XVMC_MPEG_1 : 0); 
-      curCap->mpeg_flags |= ((curInfo->mc_type & XVMC_MPEG_2) ? 
+      curCap->mpeg_flags |= ((curInfo->mc_type & XVMC_MPEG_1) ?
+			     XINE_XVMC_MPEG_1 : 0);
+      curCap->mpeg_flags |= ((curInfo->mc_type & XVMC_MPEG_2) ?
 			     XINE_XVMC_MPEG_2 : 0);
-      curCap->mpeg_flags |= ((curInfo->mc_type & XVMC_MPEG_4) ? 
+      curCap->mpeg_flags |= ((curInfo->mc_type & XVMC_MPEG_4) ?
 			     XINE_XVMC_MPEG_4 : 0);
-      curCap->accel_flags |= ((curInfo->mc_type & XVMC_VLD) ? 
+      curCap->accel_flags |= ((curInfo->mc_type & XVMC_VLD) ?
 			      XINE_XVMC_ACCEL_VLD : 0);
-      curCap->accel_flags |= ((curInfo->mc_type & XVMC_IDCT) ? 
+      curCap->accel_flags |= ((curInfo->mc_type & XVMC_IDCT) ?
 			      XINE_XVMC_ACCEL_IDCT : 0);
-      curCap->accel_flags |= ((curInfo->mc_type & (XVMC_VLD | XVMC_IDCT)) ? 
+      curCap->accel_flags |= ((curInfo->mc_type & (XVMC_VLD | XVMC_IDCT)) ?
 			      0 : XINE_XVMC_ACCEL_MOCOMP);
       curCap->max_width = curInfo->max_width;
       curCap->max_height = curInfo->max_height;
       curCap->sub_max_width = curInfo->subpicture_max_width;
       curCap->sub_max_height = curInfo->subpicture_max_height;
       curCap->flags = curInfo->flags;
-      xprintf (this->xine, XINE_VERBOSITY_DEBUG, 
+      xprintf (this->xine, XINE_VERBOSITY_DEBUG,
 	       LOG_MODULE ": Surface type %d: Max size: %d %d.\n",
 	       i,curCap->max_width,curCap->max_height);
-      xprintf (this->xine, XINE_VERBOSITY_DEBUG, 
+      xprintf (this->xine, XINE_VERBOSITY_DEBUG,
 	       LOG_MODULE ": Surface type %d: Max subpic size: %d %d.\n",
 	       i,curCap->sub_max_width,curCap->sub_max_height);
-      
+
       curCap->type_id = curInfo->surface_type_id;
-      formatValues = XvMCListSubpictureTypes( this->display, xv_port, 
+      formatValues = XvMCListSubpictureTypes( this->display, xv_port,
 					      curCap->type_id, &numSub);
       curCap->subPicType.id = 0;
       if (formatValues) {
-	xprintf (this->xine, XINE_VERBOSITY_DEBUG, 
+	xprintf (this->xine, XINE_VERBOSITY_DEBUG,
 		 LOG_MODULE ": Surface type %d: Found %d XvMC subpicture types\n",i,numSub);
 	for (j = 0; j<numSub; ++j) {
 	  if (formatValues[j].id == FOURCC_IA44) {
 	    curCap->subPicType = formatValues[j];
-	    xprintf (this->xine, XINE_VERBOSITY_DEBUG, 
+	    xprintf (this->xine, XINE_VERBOSITY_DEBUG,
 		     LOG_MODULE ": Surface type %d: Detected and using IA44 subpicture type.\n",i);
 	    /* Prefer IA44 */
 	    break;
 	  } else if (formatValues[j].id == FOURCC_AI44) {
 	    curCap->subPicType = formatValues[j];
-	    xprintf (this->xine, XINE_VERBOSITY_DEBUG, 
+	    xprintf (this->xine, XINE_VERBOSITY_DEBUG,
 		     LOG_MODULE ": Surface type %d: Detected AI44 subpicture type.\n",i);
 	  }
 	}
@@ -2384,7 +2384,7 @@
       XFree(formatValues);
 
       curInfo++;
-      curCap++;      
+      curCap++;
     }
   }
   XFree(surfaceInfo);
@@ -2393,7 +2393,7 @@
    * Try to create a direct rendering context. This will fail if we are not
    * on the displaying computer or an indirect context is not available.
    */
-  
+
   curCap = this->xvmc_cap;
   if (Success == XvMCCreateContext( this->display, xv_port, curCap->type_id,
 				    curCap->max_width,curCap->max_height,
@@ -2406,7 +2406,7 @@
   } else {
     free(this->xvmc_cap);
     this->xvmc_cap = 0;
-    xprintf (this->xine, XINE_VERBOSITY_DEBUG, 
+    xprintf (this->xine, XINE_VERBOSITY_DEBUG,
 	     LOG_MODULE ": Apparent attempt to use a direct XvMC context on a remote display.\n"
 	     LOG_MODULE ": Falling back to Xv.\n");
     XVMCUNLOCKDISPLAY( this->display );
@@ -2423,8 +2423,8 @@
   return;
 
 }
-  
-  
+
+
 
 
 static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *visual_gen) {
@@ -2445,7 +2445,7 @@
   XvAdaptorInfo        *adaptor_info;
   unsigned int          adaptor_num;
   xv_prefertype		prefer_type;
-  cfg_entry_t          *entry;     
+  cfg_entry_t          *entry;
   int                   use_more_frames;
   int                   use_unscaled;
 
@@ -2454,7 +2454,7 @@
     return NULL;
 
   _x_alphablend_init(&this->alphablend_extra_data, class->xine);
-  
+
   this->display           = visual->display;
   this->screen            = visual->screen;
   this->config            = config;
@@ -2512,19 +2512,19 @@
 	    _("%s: Xv extension is present but I couldn't find a usable yuv12 port.\n"
 	      "\tLooks like your graphics hardware driver doesn't support Xv?!\n"),
 	    LOG_MODULE);
-    
+
     /* XvFreeAdaptorInfo (adaptor_info); this crashed on me (gb)*/
     XUnlockDisplay(this->display);
     return NULL;
-  } 
+  }
   else
     xprintf(class->xine, XINE_VERBOSITY_LOG,
 	    _("%s: using Xv port %ld from adaptor %s for hardware "
 	      "colour space conversion and scaling.\n"), LOG_MODULE, xv_port,
             adaptor_info[adaptor_num].name);
-  
+
   XUnlockDisplay(this->display);
-  
+
   this->xv_port           = xv_port;
 
   _x_vo_scale_init (&this->sc, 1, 0, config );
@@ -2673,10 +2673,10 @@
 
   fo = XvListImageFormats(this->display, this->xv_port, (int*)&formats);
   XUnlockDisplay (this->display);
-  
+
   this->xv_format_yv12 = 0;
   this->xv_format_yuy2 = 0;
-  
+
   for(i = 0; i < formats; i++) {
     lprintf ("Xv image format: 0x%x (%4.4s) %s\n",
 	     fo[i].id, (char*)&fo[i].id,
@@ -2692,7 +2692,7 @@
     case XINE_IMGFMT_YUY2:
       this->xv_format_yuy2 = fo[i].id;
       this->capabilities |= VO_CAP_YUY2;
-      xprintf(this->xine, XINE_VERBOSITY_LOG, 
+      xprintf(this->xine, XINE_VERBOSITY_LOG,
 	      _("%s: this adaptor supports the %s format.\n"), LOG_MODULE, "YUY2");
       break;
     default:
@@ -2717,19 +2717,19 @@
   dispose_ximage (this, &myshminfo, myimage);
   XUnlockDisplay (this->display);
 
-  this->use_pitch_alignment = 
+  this->use_pitch_alignment =
     config->register_bool (config, "video.device.xv_pitch_alignment", 0,
 			   VIDEO_DEVICE_XV_PITCH_ALIGNMENT_HELP,
 			   10, xxmc_update_xv_pitch_alignment, this);
 
-  use_more_frames= 
+  use_more_frames=
     config->register_bool (config, "video.device.xvmc_more_frames", 0,
 			   _("Make XvMC allocate more frames for better buffering."),
 			   _("Some XvMC implementations allow more than 8 frames.\n"
 			     "This option, when turned on, makes the driver try to\n"
 			     "allocate 15 frames. A must for unichrome and live VDR.\n"),
 			   10, NULL, this);
-  this->cpu_save_enabled = 
+  this->cpu_save_enabled =
     config->register_bool (config, "video.device.unichrome_cpu_save", 0,
 			   _("Unichrome cpu save"),
 			   _("Saves CPU time by sleeping while decoder works.\n"
@@ -2768,7 +2768,7 @@
 
 #ifdef HAVE_VLDXVMC
   printf("%s: Unichrome CPU saving is %s.\n", LOG_MODULE,
-	 (this->cpu_save_enabled) ? "on":"off"); 
+	 (this->cpu_save_enabled) ? "on":"off");
 #else
   printf("%s: warning - compiled with no vld extensions.\n", LOG_MODULE);
 #endif
@@ -2797,10 +2797,10 @@
     }
     XUnlockDisplay (this->display);
   }
-  
+
   if( this->xoverlay ) {
     this->capabilities |= VO_CAP_UNSCALED_OVERLAY;
-  } 
+  }
   return &this->vo_driver;
 }
 
@@ -2838,4 +2838,4 @@
   { PLUGIN_VIDEO_OUT, 22, "xxmc", XINE_VERSION_CODE, &vo_info_xxmc, init_class },
   { PLUGIN_NONE, 0, "", 0, NULL, NULL }
 };
- 
+