--- faac-1.28.orig/common/mp4v2/mp4file_io.cpp +++ faac-1.28/common/mp4v2/mp4file_io.cpp @@ -34,13 +34,11 @@ } return fpos; } else { - fpos_t fpos; - if (fgetpos(pFile, &fpos) < 0) { + off_t off = ftello(pFile); + if (off == -1) { throw new MP4Error(errno, "MP4GetPosition"); } - uint64_t ret; - FPOS_TO_VAR(fpos, uint64_t, ret); - return ret; + return off; } } else { return m_memoryBufferPosition; @@ -56,9 +54,7 @@ throw new MP4Error("setting position via Virtual I/O", "MP4SetPosition"); } } else { - fpos_t fpos; - VAR_TO_FPOS(fpos, pos); - if (fsetpos(pFile, &fpos) < 0) { + if (fseeko(pFile, pos, SEEK_SET) < 0) { throw new MP4Error(errno, "MP4SetPosition"); } } --- faac-1.28.orig/common/mp4v2/mp4util.h +++ faac-1.28/common/mp4v2/mp4util.h @@ -23,6 +23,10 @@ #define __MP4_UTIL_INCLUDED__ #include +#ifndef __STRING +#define __STRING(x) #x +#endif + #ifndef ASSERT #define ASSERT(expr) \ if (!(expr)) { \ --- faac-1.28.orig/common/mp4v2/mpeg4ip.h +++ faac-1.28/common/mp4v2/mpeg4ip.h @@ -153,14 +153,6 @@ #define TO_U64(a) (a##LLU) #endif -#ifdef HAVE_FPOS_T___POS -#define FPOS_TO_VAR(fpos, typed, var) (var) = (typed)((fpos).__pos) -#define VAR_TO_FPOS(fpos, var) (fpos).__pos = (var) -#else -#define FPOS_TO_VAR(fpos, typed, var) (var) = (typed)(fpos) -#define VAR_TO_FPOS(fpos, var) (fpos) = (var) -#endif - #define FOPEN_READ_BINARY "r" #define FOPEN_WRITE_BINARY "w" #define UINT64_TO_DOUBLE(a) ((double)(a)) --- faac-1.28.orig/common/mp4v2/virtual_io.cpp +++ faac-1.28/common/mp4v2/virtual_io.cpp @@ -38,21 +38,18 @@ int FILE_SetPosition(void *user, u_int64_t position) { - FILE *fp = (FILE *)user; - fpos_t fpos; - VAR_TO_FPOS(fpos, position); - return fsetpos(fp, &fpos); + return fseeko((FILE *) user, position, SEEK_SET); } int FILE_GetPosition(void *user, u_int64_t *position) { FILE *fp = (FILE *)user; - fpos_t fpos; - if (fgetpos(fp, &fpos) < 0) { + off_t off; + off = ftello(fp); + if (off == -1) { throw new MP4Error(errno, "MP4GetPosition"); } - - FPOS_TO_VAR(fpos, u_int64_t, *position); + *position = off; return 0; }