aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-04-25 02:47:47 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-04-25 03:49:47 +0200
commit2ebd47841f16d1d521d7dd9b5ae0b8015443b690 (patch)
tree5e32bef0eda02346d15fa212326806ab58e9103b /libavutil
parent9d7244c4c60d9f85f58b3770065a394c71fdce3f (diff)
parent989fb05fe344d9666db858e0577c44969625184e (diff)
downloadffmpeg-2ebd47841f16d1d521d7dd9b5ae0b8015443b690.tar.gz
Merge branch 'master' into oldabi
* master: (172 commits) Check mmap() return against correct value Signed-off-by: Michael Niedermayer <michaelni@gmx.at> vorbisdec: Employ proper printf format specifiers for uint_fast32_t. Support fourcc MMJP. Support fourcc XVIX. Support fourcc M263. Support fourcc auv2. Fix indentation. Support PARSER_FLAG_COMPLETE_FRAMES for h261 and h263 parsers. ffplay: avoid SIGFPE exception in SDL_DisplayYUVOverlay avi: try to synchronize the points in time of the starts of streams after seeking. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Add flag to force demuxers to sort more strictly by dts. This enables non interleaved AVI mode for example. Players that are picky on strict interleaving can set this. Patches to only switch to non intereaved AVI mode when the index is not strictly correctly interleaved are welcome. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> applehttp: Don't export variant_bitrate if it isn't known crypto: Use av_freep instead of av_free CrystalHD: Add AVOption to configure hardware downscaling. Check for malloc failures in fraps decoder. Use av_fast_malloc instead of av_realloc in fraps decoder. general.texi: document libcelt decoder. Fix some passing argument from incompatible pointer type warnings. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> configure: Add missing libm library dependencies to .pc files. oggdec: reindent after 8f3eebd6 ... Conflicts: libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/avutil.h3
-rw-r--r--libavutil/error.c3
-rw-r--r--libavutil/error.h13
-rw-r--r--libavutil/libm.h7
-rw-r--r--libavutil/opt.c6
-rw-r--r--libavutil/sha1.h57
-rw-r--r--libavutil/x86/bswap.h4
7 files changed, 24 insertions, 69 deletions
diff --git a/libavutil/avutil.h b/libavutil/avutil.h
index e44a2b7c6f..f25c0ce709 100644
--- a/libavutil/avutil.h
+++ b/libavutil/avutil.h
@@ -58,7 +58,8 @@
* They may change, break or disappear at any time.
*/
#ifndef FF_API_OLD_EVAL_NAMES
-#define FF_API_OLD_EVAL_NAMES (LIBAVUTIL_VERSION_MAJOR < 51)
+#define FF_API_OLD_EVAL_NAMES (LIBAVUTIL_VERSION_MAJOR < 52)
+
#endif
/**
diff --git a/libavutil/error.c b/libavutil/error.c
index 93f8925d44..d6419ca9b8 100644
--- a/libavutil/error.c
+++ b/libavutil/error.c
@@ -28,11 +28,12 @@ int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
case AVERROR_EOF: errstr = "End of file"; break;
case AVERROR_INVALIDDATA: errstr = "Invalid data found when processing input"; break;
case AVERROR_NUMEXPECTED: errstr = "Number syntax expected in filename"; break;
- case AVERROR_PATCHWELCOME: errstr = "Not yet implemented in FFmpeg, patches welcome"; break;
+ case AVERROR_PATCHWELCOME: errstr = "Not yet implemented in Libav, patches welcome"; break;
case AVERROR_DEMUXER_NOT_FOUND: errstr = "Demuxer not found"; break;
case AVERROR_MUXER_NOT_FOUND: errstr = "Muxer not found"; break;
case AVERROR_DECODER_NOT_FOUND: errstr = "Decoder not found"; break;
case AVERROR_ENCODER_NOT_FOUND: errstr = "Encoder not found"; break;
+ case AVERROR_OPTION_NOT_FOUND: errstr = "Option not found"; break;
case AVERROR_PROTOCOL_NOT_FOUND:errstr = "Protocol not found"; break;
case AVERROR_FILTER_NOT_FOUND: errstr = "Filter not found"; break;
case AVERROR_BSF_NOT_FOUND: errstr = "Bitstream filter not found"; break;
diff --git a/libavutil/error.h b/libavutil/error.h
index 0d475664c7..8b5dbe01d6 100644
--- a/libavutil/error.h
+++ b/libavutil/error.h
@@ -50,7 +50,7 @@
#define AVERROR_EOF AVERROR(EPIPE) ///< End of file
-#define AVERROR_PATCHWELCOME (-MKTAG('P','A','W','E')) ///< Not yet implemented in FFmpeg, patches welcome
+#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
@@ -59,15 +59,18 @@
#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
+
+#define AVERROR_BSF_NOT_FOUND (-MKTAG(0xF8,'B','S','F')) ///< Bitstream filter not found
#define AVERROR_DECODER_NOT_FOUND (-MKTAG(0xF8,'D','E','C')) ///< Decoder not found
+#define AVERROR_DEMUXER_NOT_FOUND (-MKTAG(0xF8,'D','E','M')) ///< Demuxer not found
#define AVERROR_ENCODER_NOT_FOUND (-MKTAG(0xF8,'E','N','C')) ///< Encoder not found
-#define AVERROR_PROTOCOL_NOT_FOUND (-MKTAG(0xF8,'P','R','O')) ///< Protocol not found
+#define AVERROR_EXIT (-MKTAG( 'E','X','I','T')) ///< Immediate exit was requested; the called function should not be restarted
#define AVERROR_FILTER_NOT_FOUND (-MKTAG(0xF8,'F','I','L')) ///< Filter not found
-#define AVERROR_BSF_NOT_FOUND (-MKTAG(0xF8,'B','S','F')) ///< Bitstream filter not found
+#define AVERROR_MUXER_NOT_FOUND (-MKTAG(0xF8,'M','U','X')) ///< Muxer not found
+#define AVERROR_OPTION_NOT_FOUND (-MKTAG(0xF8,'O','P','T')) ///< Option not found
+#define AVERROR_PROTOCOL_NOT_FOUND (-MKTAG(0xF8,'P','R','O')) ///< Protocol not found
#define AVERROR_STREAM_NOT_FOUND (-MKTAG(0xF8,'S','T','R')) ///< Stream not found
-#define AVERROR_EXIT (-MKTAG('E','X','I','T')) ///< Immediate exit was requested; the called function should not be restarted
-
/**
* Put a description of the AVERROR code errnum in errbuf.
* In case of failure the global variable errno is set to indicate the
diff --git a/libavutil/libm.h b/libavutil/libm.h
index c7c28ac27c..7e5f668e16 100644
--- a/libavutil/libm.h
+++ b/libavutil/libm.h
@@ -86,6 +86,13 @@ static av_always_inline av_const float roundf(float x)
}
#endif /* HAVE_ROUNDF */
+#if !HAVE_TRUNC
+static av_always_inline av_const double trunc(double x)
+{
+ return (x > 0) ? floor(x) : ceil(x);
+}
+#endif /* HAVE_TRUNC */
+
#if !HAVE_TRUNCF
static av_always_inline av_const float truncf(float x)
{
diff --git a/libavutil/opt.c b/libavutil/opt.c
index ab6021c71a..e6cf34081c 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -57,7 +57,7 @@ static int av_set_number2(void *obj, const char *name, double num, int den, int6
if (o_out)
*o_out= o;
if (!o || o->offset<=0)
- return AVERROR(ENOENT);
+ return AVERROR_OPTION_NOT_FOUND;
if (o->max*den < num*intnum || o->min*den > num*intnum) {
av_log(obj, AV_LOG_ERROR, "Value %lf for parameter '%s' out of range\n", num, name);
@@ -119,7 +119,7 @@ int av_set_string3(void *obj, const char *name, const char *val, int alloc, cons
if (o_out)
*o_out = o;
if (!o)
- return AVERROR(ENOENT);
+ return AVERROR_OPTION_NOT_FOUND;
if (!val || o->offset<=0)
return AVERROR(EINVAL);
@@ -490,7 +490,7 @@ static int parse_key_value_pair(void *ctx, const char **buf,
av_log(ctx, AV_LOG_DEBUG, "Setting value '%s' for key '%s'\n", val, key);
ret = av_set_string3(ctx, key, val, 1, NULL);
- if (ret == AVERROR(ENOENT))
+ if (ret == AVERROR_OPTION_NOT_FOUND)
av_log(ctx, AV_LOG_ERROR, "Key '%s' not found.\n", key);
av_free(key);
diff --git a/libavutil/sha1.h b/libavutil/sha1.h
deleted file mode 100644
index 3ff58043ea..0000000000
--- a/libavutil/sha1.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2007 Michael Niedermayer <michaelni@gmx.at>
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_SHA1_H
-#define AVUTIL_SHA1_H
-
-#include <stdint.h>
-
-extern const int av_sha1_size;
-
-struct AVSHA1;
-
-/**
- * Initialize SHA-1 hashing.
- *
- * @param context pointer to the function context (of size av_sha_size)
- * @deprecated use av_sha_init() instead
- */
-void av_sha1_init(struct AVSHA1* context);
-
-/**
- * Update hash value.
- *
- * @param context hash function context
- * @param data input data to update hash with
- * @param len input data length
- * @deprecated use av_sha_update() instead
- */
-void av_sha1_update(struct AVSHA1* context, const uint8_t* data, unsigned int len);
-
-/**
- * Finish hashing and output digest value.
- *
- * @param context hash function context
- * @param digest buffer where output digest value is stored
- * @deprecated use av_sha_final() instead
- */
-void av_sha1_final(struct AVSHA1* context, uint8_t digest[20]);
-
-#endif /* AVUTIL_SHA1_H */
diff --git a/libavutil/x86/bswap.h b/libavutil/x86/bswap.h
index b6ceb76d32..b0d62b248a 100644
--- a/libavutil/x86/bswap.h
+++ b/libavutil/x86/bswap.h
@@ -29,9 +29,9 @@
#include "libavutil/attributes.h"
#define av_bswap16 av_bswap16
-static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
+static av_always_inline av_const unsigned av_bswap16(unsigned x)
{
- __asm__("rorw $8, %0" : "+r"(x));
+ __asm__("rorw $8, %w0" : "+r"(x));
return x;
}