diff options
author | Austin Yuan <shengquan.yuan@intel.com> | 2015-02-10 14:10:52 +0800 |
---|---|---|
committer | Austin Yuan <shengquan.yuan@intel.com> | 2015-02-13 09:56:27 +0800 |
commit | e1210585bfaf50fb7888053951b00018ff4a39b7 (patch) | |
tree | db0bb944587048722963d808917ce6edba17e79b | |
parent | 03023936763c9565bb3291f9d89d5c869bc4da9f (diff) | |
download | libva-e1210585bfaf50fb7888053951b00018ff4a39b7.tar.gz |
h264encode support for file size over 2G
Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
-rw-r--r-- | test/encode/Makefile.am | 2 | ||||
-rw-r--r-- | test/encode/h264encode.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/test/encode/Makefile.am b/test/encode/Makefile.am index 45c39a5..9a53eeb 100644 --- a/test/encode/Makefile.am +++ b/test/encode/Makefile.am @@ -29,7 +29,7 @@ INCLUDES = \ $(NULL) h264encode_SOURCES = h264encode.c -h264encode_CFLAGS = -I$(top_srcdir)/test/common -g +h264encode_CFLAGS = -I$(top_srcdir)/test/common -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE h264encode_LDADD = \ $(top_builddir)/va/libva.la \ $(top_builddir)/test/common/libva-display.la \ diff --git a/test/encode/h264encode.c b/test/encode/h264encode.c index 7da2154..13d7624 100644 --- a/test/encode/h264encode.c +++ b/test/encode/h264encode.c @@ -1707,8 +1707,8 @@ static int load_surface(VASurfaceID surface_id, unsigned long long display_order mmap_start = frame_start & (~0xfff); mmap_size = (frame_size + (frame_start & 0xfff) + 0xfff) & (~0xfff); - mmap_ptr = mmap(0, mmap_size, PROT_READ, MAP_SHARED, - fileno(srcyuv_fp), mmap_start); + mmap_ptr = mmap64(0, mmap_size, PROT_READ, MAP_SHARED, + fileno(srcyuv_fp), (off64_t)mmap_start); if (mmap_ptr == MAP_FAILED) { printf("Failed to mmap YUV file (%s)\n", strerror(errno)); return 1; @@ -2105,8 +2105,8 @@ static int calc_PSNR(double *psnr) if (recyuv_ptr) munmap(recyuv_ptr, fourM); - srcyuv_ptr = mmap(0, fourM, PROT_READ, MAP_SHARED, fileno(srcyuv_fp), i); - recyuv_ptr = mmap(0, fourM, PROT_READ, MAP_SHARED, fileno(recyuv_fp), i); + srcyuv_ptr = mmap64(0, fourM, PROT_READ, MAP_SHARED, fileno(srcyuv_fp), (off64_t)i); + recyuv_ptr = mmap64(0, fourM, PROT_READ, MAP_SHARED, fileno(recyuv_fp), (off64_t)i); if ((srcyuv_ptr == MAP_FAILED) || (recyuv_ptr == MAP_FAILED)) { printf("Failed to mmap YUV files\n"); return 1; |