diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-15 14:04:35 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-15 14:09:35 +0200 |
commit | ae237a117acbe958bea798e32249f4c2baeca5f9 (patch) | |
tree | c45fc400e59ab03d5346a82580bfc2054b9efe0f /libswscale/utils.c | |
parent | 4f5e5a05132be4946a655b991850bf81b7497893 (diff) | |
parent | 95cd815c3663603871a1f2da95846e8f72d4ea96 (diff) | |
download | ffmpeg-streaming-ae237a117acbe958bea798e32249f4c2baeca5f9.zip ffmpeg-streaming-ae237a117acbe958bea798e32249f4c2baeca5f9.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
swscale: try to use mmap only if available
configure: check for mprotect
wmapro: use planar sample format
wmalossless: output in planar sample format
wmadec: use float planar sample format output
shorten: use planar sample format
lavc: update documentation for AVFrame.extended_data
Conflicts:
libavcodec/shorten.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale/utils.c')
-rw-r--r-- | libswscale/utils.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c index 3310d78..24058c3 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1070,6 +1070,8 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, } } +#define USE_MMAP (HAVE_MMAP && HAVE_MPROTECT && defined MAP_ANONYMOUS) + /* precalculate horizontal scaler filter coefficients */ { #if HAVE_MMXEXT_INLINE @@ -1080,7 +1082,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, c->chrMmx2FilterCodeSize = initMMX2HScaler(c->chrDstW, c->chrXInc, NULL, NULL, NULL, 4); -#ifdef MAP_ANONYMOUS +#if USE_MMAP 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 @@ -1111,7 +1113,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, initMMX2HScaler(c->chrDstW, c->chrXInc, c->chrMmx2FilterCode, c->hChrFilter, (uint32_t*)c->hChrFilterPos, 4); -#ifdef MAP_ANONYMOUS +#if USE_MMAP mprotect(c->lumMmx2FilterCode, c->lumMmx2FilterCodeSize, PROT_EXEC | PROT_READ); mprotect(c->chrMmx2FilterCode, c->chrMmx2FilterCodeSize, PROT_EXEC | PROT_READ); #endif @@ -1698,7 +1700,7 @@ void sws_freeContext(SwsContext *c) av_freep(&c->hChrFilterPos); #if HAVE_MMX_INLINE -#ifdef MAP_ANONYMOUS +#if USE_MMAP if (c->lumMmx2FilterCode) munmap(c->lumMmx2FilterCode, c->lumMmx2FilterCodeSize); if (c->chrMmx2FilterCode) |