lavu: remove misc disabled cruft

This commit is contained in:
Anton Khirnov 2011-04-12 21:17:26 +02:00
parent 9e5c62c97f
commit 490a022d86
5 changed files with 8 additions and 33 deletions

View File

@ -37,25 +37,12 @@
#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

View 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);

View File

@ -29,10 +29,7 @@
#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__)

View 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)

View File

@ -62,14 +62,6 @@
#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.