scummvm random work
[patches.git] / ffmpeg-mmap-fallback.patch
CommitLineData
5e993f12 1Index: libavformat/grab.c
2===================================================================
3--- libavformat/grab.c (revision 7378)
4+++ libavformat/grab.c (working copy)
5@@ -219,8 +219,11 @@ static int grab_read_header(AVFormatCont
6 } else {
7 s->video_buf = mmap(0,s->gb_buffers.size,PROT_READ|PROT_WRITE,MAP_SHARED,video_fd,0);
8 if ((unsigned char*)-1 == s->video_buf) {
9- perror("mmap");
10- goto fail;
11+ s->video_buf = mmap(0,s->gb_buffers.size,PROT_READ|PROT_WRITE,MAP_PRIVATE,video_fd,0);
12+ if ((unsigned char*)-1 == s->video_buf) {
13+ perror("mmap");
14+ goto fail;
15+ }
16 }
17 s->gb_frame = 0;
18 s->time_frame = av_gettime() * s->frame_rate / s->frame_rate_base;