diff options
author | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-11-24 08:40:11 +0000 |
---|---|---|
committer | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-11-24 08:40:11 +0000 |
commit | 472e68dace09be833df5e8624a1bac033b730c89 (patch) | |
tree | 825ce527c378b23df3f0a0d7b1f92bf6412d2cc0 | |
parent | 5351098826082eac9b98bf614952f59a6f435e95 (diff) | |
download | mpv-472e68dace09be833df5e8624a1bac033b730c89.tar.bz2 mpv-472e68dace09be833df5e8624a1bac033b730c89.tar.xz |
Move setting of frame_buffer variable out of 'if', as preferred by Reimar.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28015 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libvo/vo_fbdev.c | 6 | ||||
-rw-r--r-- | libvo/vo_wii.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/libvo/vo_fbdev.c b/libvo/vo_fbdev.c index e91bd4246f..68e086e17c 100644 --- a/libvo/vo_fbdev.c +++ b/libvo/vo_fbdev.c @@ -933,8 +933,10 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, { 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; } diff --git a/libvo/vo_wii.c b/libvo/vo_wii.c index 9a5b54d74d..d27fe9c566 100644 --- a/libvo/vo_wii.c +++ b/libvo/vo_wii.c @@ -214,8 +214,10 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, 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; } |