From d037d797a4e1b5518839a03c004b65df860b9ebe Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 28 Dec 2006 00:32:06 +0000 Subject: [PATCH] fall back mmap() call using MAP_PRIVATE for working on no-mmu systems patch by Mike Frysinger vapier.adi _at_ gmail.com Originally committed as revision 7380 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/grab.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavformat/grab.c b/libavformat/grab.c index 2b7c5502c6..99cbe2fefa 100644 --- a/libavformat/grab.c +++ b/libavformat/grab.c @@ -219,8 +219,11 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) } else { s->video_buf = mmap(0,s->gb_buffers.size,PROT_READ|PROT_WRITE,MAP_SHARED,video_fd,0); if ((unsigned char*)-1 == s->video_buf) { - perror("mmap"); - goto fail; + s->video_buf = mmap(0,s->gb_buffers.size,PROT_READ|PROT_WRITE,MAP_PRIVATE,video_fd,0); + if ((unsigned char*)-1 == s->video_buf) { + perror("mmap"); + goto fail; + } } s->gb_frame = 0; s->time_frame = av_gettime() * s->frame_rate / s->frame_rate_base;