scummvm random work
[patches.git] / MPlayer-mmap-fall-back-map-private.patch
CommitLineData
5e993f12 1Index: libvo/vo_fbdev.c
2===================================================================
3--- libvo/vo_fbdev.c (revision 22100)
4+++ libvo/vo_fbdev.c (working copy)
5@@ -1003,10 +1003,13 @@ static int config(uint32_t width, uint32
6 #endif
7 {
8 int x_offset=0,y_offset=0;
9- if ((frame_buffer = (uint8_t *) mmap(0, fb_size, PROT_READ | PROT_WRITE,
10- MAP_SHARED, fb_dev_fd, 0)) == (uint8_t *) -1) {
11- mp_msg(MSGT_VO, MSGL_ERR, "Can't mmap %s: %s\n", fb_dev_name, strerror(errno));
12- return 1;
13+ frame_buffer = mmap(0, fb_size, PROT_READ | PROT_WRITE, MAP_SHARED, fb_dev_fd, 0);
14+ if (frame_buffer == MAP_FAILED) {
15+ frame_buffer = mmap(0, fb_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fb_dev_fd, 0);
16+ if (frame_buffer == MAP_FAILED) {
17+ mp_msg(MSGT_VO, MSGL_ERR, "Can't mmap %s: %s\n", fb_dev_name, strerror(errno));
18+ return 1;
19+ }
20 }
21
22 center = frame_buffer +
23Index: libvo/vo_fbdev2.c
24===================================================================
25--- libvo/vo_fbdev2.c (revision 22088)
26+++ libvo/vo_fbdev2.c (working copy)
27@@ -274,9 +274,13 @@ static int config(uint32_t width, uint32
28
29 fb_size = fb_finfo.smem_len;
30 fb_line_len = fb_finfo.line_length;
31- if ((frame_buffer = (uint8_t *) mmap(0, fb_size, PROT_READ | PROT_WRITE, MAP_SHARED, fb_dev_fd, 0)) == (uint8_t *) -1) {
32- mp_msg(MSGT_VO, MSGL_ERR, "[fbdev2] Can't mmap %s: %s\n", fb_dev_name, strerror(errno));
33- return 1;
34+ frame_buffer = mmap(0, fb_size, PROT_READ | PROT_WRITE, MAP_SHARED, fb_dev_fd, 0);
35+ if (frame_buffer == MAP_FAILED) {
36+ frame_buffer = mmap(0, fb_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fb_dev_fd, 0);
37+ if (frame_buffer == MAP_FAILED) {
38+ mp_msg(MSGT_VO, MSGL_ERR, "[fbdev2] Can't mmap %s: %s\n", fb_dev_name, strerror(errno));
39+ return 1;
40+ }
41 }
42 }
43