#define AVUNERROR(e) (e)
#endif
-#if LIBAVUTIL_VERSION_MAJOR < 51
-#define AVERROR_INVALIDDATA AVERROR(EINVAL) ///< Invalid data found when processing input
-#define AVERROR_IO AVERROR(EIO) ///< I/O error
-#define AVERROR_NOENT AVERROR(ENOENT) ///< No such file or directory
-#define AVERROR_NOFMT AVERROR(EILSEQ) ///< Unknown format
-#define AVERROR_NOMEM AVERROR(ENOMEM) ///< Not enough memory
-#define AVERROR_NOTSUPP AVERROR(ENOSYS) ///< Operation not supported
-#define AVERROR_NUMEXPECTED AVERROR(EDOM) ///< Number syntax expected in filename
-#define AVERROR_UNKNOWN AVERROR(EINVAL) ///< Unknown error
-#endif
-
#define AVERROR_EOF AVERROR(EPIPE) ///< End of file
#define AVERROR_PATCHWELCOME (-MKTAG('P','A','W','E')) ///< Not yet implemented in Libav, patches welcome
-#if LIBAVUTIL_VERSION_MAJOR > 50
#define AVERROR_INVALIDDATA (-MKTAG('I','N','D','A')) ///< Invalid data found when processing input
#define AVERROR_NUMEXPECTED (-MKTAG('N','U','E','X')) ///< Number syntax expected in filename
-#endif
#define AVERROR_DEMUXER_NOT_FOUND (-MKTAG(0xF8,'D','E','M')) ///< Demuxer not found
#define AVERROR_MUXER_NOT_FOUND (-MKTAG(0xF8,'M','U','X')) ///< Muxer not found
av_unused void *ptr;
off_t off_size;
char errbuf[128];
- size_t max_size = HAVE_MMAP ? SIZE_MAX : FF_INTERNAL_MEM_TYPE_MAX_VALUE;
*bufptr = NULL;
if (fd < 0) {
}
off_size = st.st_size;
- if (off_size > max_size) {
+ if (off_size > SIZE_MAX) {
av_log(&file_log_ctx, AV_LOG_ERROR,
"File size for file '%s' is too big\n", filename);
close(fd);
#include "avutil.h"
#include "log.h"
-#if LIBAVUTIL_VERSION_MAJOR > 50
-static
-#endif
-int av_log_level = AV_LOG_INFO;
+static int av_log_level = AV_LOG_INFO;
static int flags;
#if defined(_WIN32) && !defined(__MINGW32CE__)
memory allocator. You do not need to suppress this file because the
linker will do it automatically. */
-void *av_malloc(FF_INTERNAL_MEM_TYPE size)
+void *av_malloc(size_t size)
{
void *ptr = NULL;
#if CONFIG_MEMALIGN_HACK
return ptr;
}
-void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size)
+void *av_realloc(void *ptr, size_t size)
{
#if CONFIG_MEMALIGN_HACK
int diff;
*ptr = NULL;
}
-void *av_mallocz(FF_INTERNAL_MEM_TYPE size)
+void *av_mallocz(size_t size)
{
void *ptr = av_malloc(size);
if (ptr)
#define av_alloc_size(n)
#endif
-#if LIBAVUTIL_VERSION_MAJOR < 51
-# define FF_INTERNAL_MEM_TYPE unsigned int
-# define FF_INTERNAL_MEM_TYPE_MAX_VALUE UINT_MAX
-#else
-# define FF_INTERNAL_MEM_TYPE size_t
-# define FF_INTERNAL_MEM_TYPE_MAX_VALUE SIZE_MAX
-#endif
-
/**
* Allocate a block of size bytes with alignment suitable for all
* memory accesses (including vectors if available on the CPU).
* be allocated.
* @see av_mallocz()
*/
-void *av_malloc(FF_INTERNAL_MEM_TYPE size) av_malloc_attrib av_alloc_size(1);
+void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
/**
* Allocate or reallocate a block of memory.
* cannot be reallocated or the function is used to free the memory block.
* @see av_fast_realloc()
*/
-void *av_realloc(void *ptr, FF_INTERNAL_MEM_TYPE size) av_alloc_size(2);
+void *av_realloc(void *ptr, size_t size) av_alloc_size(2);
/**
* Free a memory block which has been allocated with av_malloc(z)() or
* @return Pointer to the allocated block, NULL if it cannot be allocated.
* @see av_malloc()
*/
-void *av_mallocz(FF_INTERNAL_MEM_TYPE size) av_malloc_attrib av_alloc_size(1);
+void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1);
/**
* Duplicate the string s.