From 5e997688f8801bb89c773f368237627d957fa520 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 7 Aug 2012 00:18:59 +0200 Subject: [PATCH 1/5] h264: Remove an assert on current_picture_ptr being null MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is possible in various error paths as well as gap handling that this has already been allocated. It is not clear why that would be a problem with the current code, thus disable the assert to avoid a common assert failure when asserts are enabled. Signed-off-by: Martin Storsjö --- libavcodec/h264.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 2c4f07d601..99cf5dc9f3 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -2773,7 +2773,6 @@ static int decode_slice_header(H264Context *h, H264Context *h0) } } else { /* Frame or first field in a potentially complementary pair */ - assert(!s0->current_picture_ptr); s0->first_field = FIELD_PICTURE; } From 6d65496990dcac551f60668c2418a50a3111c86c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Tue, 4 Sep 2012 14:45:00 +0300 Subject: [PATCH 2/5] parser: Don't use pc as context for av_dlog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ParserContext class doesn't have an AVClass, required for using it as a logging class. Signed-off-by: Martin Storsjö --- libavcodec/parser.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/parser.c b/libavcodec/parser.c index 29904f9a33..dd2d836615 100644 --- a/libavcodec/parser.c +++ b/libavcodec/parser.c @@ -225,9 +225,9 @@ void av_parser_close(AVCodecParserContext *s) int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size) { if(pc->overread){ - av_dlog(pc, "overread %d, state:%X next:%d index:%d o_index:%d\n", + av_dlog(NULL, "overread %d, state:%X next:%d index:%d o_index:%d\n", pc->overread, pc->state, next, pc->index, pc->overread_index); - av_dlog(pc, "%X %X %X %X\n", (*buf)[0], (*buf)[1], (*buf)[2], (*buf)[3]); + av_dlog(NULL, "%X %X %X %X\n", (*buf)[0], (*buf)[1], (*buf)[2], (*buf)[3]); } /* Copy overread bytes from last frame into buffer. */ @@ -277,9 +277,9 @@ int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_s } if(pc->overread){ - av_dlog(pc, "overread %d, state:%X next:%d index:%d o_index:%d\n", + av_dlog(NULL, "overread %d, state:%X next:%d index:%d o_index:%d\n", pc->overread, pc->state, next, pc->index, pc->overread_index); - av_dlog(pc, "%X %X %X %X\n", (*buf)[0], (*buf)[1],(*buf)[2],(*buf)[3]); + av_dlog(NULL, "%X %X %X %X\n", (*buf)[0], (*buf)[1],(*buf)[2],(*buf)[3]); } return 0; From a3222470de7b1440534a98d32e425ef9ea6e5384 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Tue, 4 Sep 2012 15:20:45 +0100 Subject: [PATCH 3/5] build: disable ranlib on mingw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using ranlib is not required but prevents using the libraries with msvc. Signed-off-by: Mans Rullgard Signed-off-by: Martin Storsjö --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 1d889d6cbc..7f95acf572 100755 --- a/configure +++ b/configure @@ -2707,6 +2707,7 @@ case $target_os in SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base' objformat="win32" dlltool="${cross_prefix}dlltool" + ranlib=: enable dos_paths check_cflags -fno-common check_cpp_condition _mingw.h "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) \ From b797f3c4d01e62b4db689d69bf417cced9099b06 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Tue, 4 Sep 2012 13:57:37 +0100 Subject: [PATCH 4/5] configure: add section for libc-specific hacks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- configure | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 7f95acf572..1c61e4bd9e 100755 --- a/configure +++ b/configure @@ -2710,9 +2710,6 @@ case $target_os in ranlib=: enable dos_paths check_cflags -fno-common - check_cpp_condition _mingw.h "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) \ - || (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" || - die "ERROR: MinGW runtime version must be >= 3.15." add_cppflags -U__STRICT_ANSI__ ;; cygwin*) @@ -2797,6 +2794,26 @@ case $target_os in ;; esac +# determine libc flavour + +if check_cpp_condition features.h "defined __UCLIBC__"; then + libc_type=uclibc +elif check_cpp_condition features.h "defined __GLIBC__"; then + libc_type=glibc +elif check_header _mingw.h; then + libc_type=mingw + check_cpp_condition _mingw.h \ + "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) || \ + (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" || + die "ERROR: MinGW runtime version must be >= 3.15." +elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then + libc_type=newlib +elif check_cpp_condition stddef.h "defined __KLIBC__"; then + libc_type=klibc +fi + +test -n "$libc_type" && enable $libc_type + esc(){ echo "$*" | sed 's/%/%25/g;s/:/%3a/g' } From 0db2d94280e260af5f3ad7993c5a6357462f17c9 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Wed, 25 Jul 2012 16:22:34 +0200 Subject: [PATCH 5/5] dsputil: workaround __VA_ARGS__ missing tokenization for MSVC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A second expansion forces the preprocessor to tokenize properly. Signed-off-by: Martin Storsjö --- libavcodec/dsputil.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index e47cd2cec2..bb70428e2a 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -622,22 +622,26 @@ void ff_mlp_init_x86(DSPContext* c, AVCodecContext *avctx); # define STRIDE_ALIGN 8 #endif +// Some broken preprocessors need a second expansion +// to be forced to tokenize __VA_ARGS__ +#define E(x) x + #define LOCAL_ALIGNED_A(a, t, v, s, o, ...) \ uint8_t la_##v[sizeof(t s o) + (a)]; \ t (*v) o = (void *)FFALIGN((uintptr_t)la_##v, a) #define LOCAL_ALIGNED_D(a, t, v, s, o, ...) DECLARE_ALIGNED(a, t, v) s o -#define LOCAL_ALIGNED(a, t, v, ...) LOCAL_ALIGNED_A(a, t, v, __VA_ARGS__,,) +#define LOCAL_ALIGNED(a, t, v, ...) E(LOCAL_ALIGNED_A(a, t, v, __VA_ARGS__,,)) #if HAVE_LOCAL_ALIGNED_8 -# define LOCAL_ALIGNED_8(t, v, ...) LOCAL_ALIGNED_D(8, t, v, __VA_ARGS__,,) +# define LOCAL_ALIGNED_8(t, v, ...) E(LOCAL_ALIGNED_D(8, t, v, __VA_ARGS__,,)) #else # define LOCAL_ALIGNED_8(t, v, ...) LOCAL_ALIGNED(8, t, v, __VA_ARGS__) #endif #if HAVE_LOCAL_ALIGNED_16 -# define LOCAL_ALIGNED_16(t, v, ...) LOCAL_ALIGNED_D(16, t, v, __VA_ARGS__,,) +# define LOCAL_ALIGNED_16(t, v, ...) E(LOCAL_ALIGNED_D(16, t, v, __VA_ARGS__,,)) #else # define LOCAL_ALIGNED_16(t, v, ...) LOCAL_ALIGNED(16, t, v, __VA_ARGS__) #endif