changeset 1604:ec546897df3d libavformat

fall back mmap() call using MAP_PRIVATE for working on no-mmu systems patch by Mike Frysinger vapier.adi _at_ gmail.com
author aurel
date Thu, 28 Dec 2006 00:32:06 +0000
parents 26a7d15e4c9d
children 6d66c6325e0d
files grab.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/grab.c	Thu Dec 28 00:24:24 2006 +0000
+++ b/grab.c	Thu Dec 28 00:32:06 2006 +0000
@@ -219,8 +219,11 @@
     } 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;