aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/grab.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier.adi@gmail.com>2006-12-28 00:32:06 +0000
committerAurelien Jacobs <aurel@gnuage.org>2006-12-28 00:32:06 +0000
commitd037d797a4e1b5518839a03c004b65df860b9ebe (patch)
treeac1cba70075535a1e51278f3e3203352bf1f0633 /libavformat/grab.c
parent62ade082bbe679f266cbb56bc05d25044e32341d (diff)
downloadffmpeg-d037d797a4e1b5518839a03c004b65df860b9ebe.tar.gz
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
Diffstat (limited to 'libavformat/grab.c')
-rw-r--r--libavformat/grab.c7
1 files 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;