[MPlayer-cvslog] r28015 - in trunk/libvo: vo_fbdev.c vo_wii.c

diego subversion at mplayerhq.hu
Mon Nov 24 09:40:11 CET 2008


Author: diego
Date: Mon Nov 24 09:40:11 2008
New Revision: 28015

Log:
Move setting of frame_buffer variable out of 'if', as preferred by Reimar.


Modified:
   trunk/libvo/vo_fbdev.c
   trunk/libvo/vo_wii.c

Modified: trunk/libvo/vo_fbdev.c
==============================================================================
--- trunk/libvo/vo_fbdev.c	(original)
+++ trunk/libvo/vo_fbdev.c	Mon Nov 24 09:40:11 2008
@@ -933,8 +933,10 @@ static int config(uint32_t width, uint32
     {
         int x_offset = 0, y_offset = 0;
         geometry(&x_offset, &y_offset, &out_width, &out_height, fb_xres, fb_yres);
-        if ((frame_buffer = (uint8_t *) mmap(0, fb_size, PROT_READ | PROT_WRITE,
-                                             MAP_SHARED, fb_dev_fd, 0)) == (uint8_t *) -1) {
+
+        frame_buffer = (uint8_t *) mmap(0, fb_size, PROT_READ | PROT_WRITE,
+                                        MAP_SHARED, fb_dev_fd, 0);
+        if (frame_buffer == (uint8_t *) -1) {
         mp_msg(MSGT_VO, MSGL_ERR, "Can't mmap %s: %s\n", fb_dev_name, strerror(errno));
         return 1;
         }

Modified: trunk/libvo/vo_wii.c
==============================================================================
--- trunk/libvo/vo_wii.c	(original)
+++ trunk/libvo/vo_wii.c	Mon Nov 24 09:40:11 2008
@@ -214,8 +214,10 @@ static int config(uint32_t width, uint32
   fb_line_len = fb_finfo.line_length;
   fb_size     = fb_finfo.smem_len;
   frame_buffer = NULL;
-  if ((frame_buffer = (uint8_t *) mmap(0, fb_size, PROT_READ | PROT_WRITE,
-                                       MAP_SHARED, fb_dev_fd, 0)) == (uint8_t *) -1) {
+
+  frame_buffer = (uint8_t *) mmap(0, fb_size, PROT_READ | PROT_WRITE,
+                                  MAP_SHARED, fb_dev_fd, 0);
+  if (frame_buffer == (uint8_t *) -1) {
     mp_msg(MSGT_VO, MSGL_ERR, "Can't mmap %s: %s\n", fb_dev_name, strerror(errno));
     return 1;
   }



More information about the MPlayer-cvslog mailing list