diff options
author | Grant Carver <grantc@cat.co.za> | 2010-08-19 23:48:19 +0000 |
---|---|---|
committer | Ramiro Polla <ramiro.polla@gmail.com> | 2010-08-19 23:48:19 +0000 |
commit | 53bc0dc2bdc1566156331ebe1c1d7bf0e0879c1f (patch) | |
tree | d8a8d193af439e5affd8031be7b536c724d7c723 /libswscale | |
parent | 364cacc7c7767f5ce147b4af5116fd5c427b0d5a (diff) | |
download | ffmpeg-53bc0dc2bdc1566156331ebe1c1d7bf0e0879c1f.tar.gz |
fix anonymous memory mapping for NetBSD
mmap() with MAP_ANONYMOUS requires the file descriptor to be -1 in NetBSD.
Linux just ignores this parameter.
Patch by Grant Carver <grantc at cat dot co dot za>
Originally committed as revision 31984 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c index 9d2a4689e6..35e11269e7 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -897,8 +897,8 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, c->chrMmx2FilterCodeSize = initMMX2HScaler(c->chrDstW, c->chrXInc, NULL, NULL, NULL, 4); #ifdef MAP_ANONYMOUS - c->lumMmx2FilterCode = mmap(NULL, c->lumMmx2FilterCodeSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); - c->chrMmx2FilterCode = mmap(NULL, c->chrMmx2FilterCodeSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); + c->lumMmx2FilterCode = mmap(NULL, c->lumMmx2FilterCodeSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + c->chrMmx2FilterCode = mmap(NULL, c->chrMmx2FilterCodeSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); #elif HAVE_VIRTUALALLOC c->lumMmx2FilterCode = VirtualAlloc(NULL, c->lumMmx2FilterCodeSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE); c->chrMmx2FilterCode = VirtualAlloc(NULL, c->chrMmx2FilterCodeSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE); |