]> git.sesse.net Git - ffmpeg/commitdiff
lavu: remove misc disabled cruft
authorAnton Khirnov <anton@khirnov.net>
Tue, 12 Apr 2011 19:17:26 +0000 (21:17 +0200)
committerAnton Khirnov <anton@khirnov.net>
Tue, 19 Apr 2011 17:04:28 +0000 (19:04 +0200)
libavutil/error.h
libavutil/file.c
libavutil/log.c
libavutil/mem.c
libavutil/mem.h

index 8c83ecde77b14527385463c4c7ea09b974f58d36..33332b18c4487478400bc033256dd1028f7dcbc9 100644 (file)
 #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
index 757e73bafb46f310f1c813e0c1bd81966bd8706b..3dcce7c2f8894ded506b520153b19b23a3946f4d 100644 (file)
@@ -47,7 +47,6 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
     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) {
@@ -66,7 +65,7 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
     }
 
     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);
index 3b8244889f9aef07da1c143346faa90a10d13566..72d2b914bdb5ed9c8b6f550aea50b77f40e76f40 100644 (file)
 #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__)
index 7a54bd0f7eed67dde165265031f39cf8d4d9f7b3..2aef9b0a1b77e1fb9b1db2b790b5c579b3e5ad70 100644 (file)
@@ -61,7 +61,7 @@ void  free(void *ptr);
    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
@@ -116,7 +116,7 @@ void *av_malloc(FF_INTERNAL_MEM_TYPE size)
     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;
@@ -153,7 +153,7 @@ void av_freep(void *arg)
     *ptr = NULL;
 }
 
-void *av_mallocz(FF_INTERNAL_MEM_TYPE size)
+void *av_mallocz(size_t size)
 {
     void *ptr = av_malloc(size);
     if (ptr)
index f52777b07167c405bf30da6c8bf9277ba919eacf..5dea49202143770cf3592dedd0bde9dccced9f3a 100644 (file)
     #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).
@@ -78,7 +70,7 @@
  * 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.
@@ -92,7 +84,7 @@ void *av_malloc(FF_INTERNAL_MEM_TYPE size) av_malloc_attrib av_alloc_size(1);
  * 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
@@ -112,7 +104,7 @@ void av_free(void *ptr);
  * @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.