From f2e1240a527923f9f77c81407283ff482eff814e Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Fri, 30 Dec 2016 16:02:37 +0100 Subject: [PATCH] ffmpeg: finish work on version 0.10.16. - Complete the patch to disable everything that results in undefined symbols - Checked working for decoding (h264, aac, mp3, ogg/vorbis, AIFF) - Not checked for encoding. --- media-video/ffmpeg/ffmpeg-0.10.14.recipe | 145 -- .../ffmpeg/ffmpeg_legacy-0.11.5.recipe | 166 -- .../ffmpeg/patches/ffmpeg-0.10.14.patchset | 1604 ----------------- .../ffmpeg/patches/ffmpeg-0.10.16.patchset | 230 ++- .../ffmpeg/patches/ffmpeg-0.11.5.patchset | 1043 ----------- 5 files changed, 145 insertions(+), 3043 deletions(-) delete mode 100644 media-video/ffmpeg/ffmpeg-0.10.14.recipe delete mode 100644 media-video/ffmpeg/ffmpeg_legacy-0.11.5.recipe delete mode 100644 media-video/ffmpeg/patches/ffmpeg-0.10.14.patchset delete mode 100644 media-video/ffmpeg/patches/ffmpeg-0.11.5.patchset diff --git a/media-video/ffmpeg/ffmpeg-0.10.14.recipe b/media-video/ffmpeg/ffmpeg-0.10.14.recipe deleted file mode 100644 index 9081d04da0..0000000000 --- a/media-video/ffmpeg/ffmpeg-0.10.14.recipe +++ /dev/null @@ -1,145 +0,0 @@ -SUMMARY="Audio and video recording, conversion, and streaming library" -DESCRIPTION=" -FFmpeg is a complete, cross-platform solution to record, convert and stream \ -audio and video. It includes libavcodec - the leading audio/video codec library. -" -HOMEPAGE="http://www.ffmpeg.org" -LICENSE="GNU LGPL v2.1 - GNU GPL v2" -COPYRIGHT="2000-2003 Fabrice Bellard - 2003-2012 the FFmpeg developers" -SOURCE_URI="http://www.ffmpeg.org/releases/ffmpeg-0.10.14.tar.bz2" -CHECKSUM_SHA256="1ef77533f3803b8630403df413005c1c41b18c50b16895815182fd70d2f833bb" -REVISION="4" -SOURCE_DIR="ffmpeg-$portVersion" -ARCHITECTURES="x86_gcc2 !x86 !x86_64" -SECONDARY_ARCHITECTURES="x86_gcc2 !x86" -PATCHES="ffmpeg-0.10.14.patchset" - -PROVIDES=" - ffmpeg$secondaryArchSuffix = $portVersion compat >= 0.10 - lib:libavutil$secondaryArchSuffix = 51.35.100 compat >= 51 - lib:libavcodec$secondaryArchSuffix = 53.61.100 compat >= 53 - lib:libavformat$secondaryArchSuffix = 53.32.100 compat >= 53 - lib:libavdevice$secondaryArchSuffix = 53.4.100 compat >= 53 - lib:libavfilter$secondaryArchSuffix = 2.61.100 compat >= 2 - lib:libpostproc$secondaryArchSuffix = 52.0.100 compat >= 52 - lib:libswscale$secondaryArchSuffix = 2.1.100 compat >= 2 - lib:libswresample$secondaryArchSuffix = 0.6.100 compat >= 0 - " -REQUIRES=" - haiku$secondaryArchSuffix - lib:libbz2$secondaryArchSuffix - lib:libmodplug$secondaryArchSuffix - lib:libogg$secondaryArchSuffix - lib:libspeex$secondaryArchSuffix - lib:libtheoradec$secondaryArchSuffix - lib:libtheoraenc$secondaryArchSuffix - lib:libvorbis$secondaryArchSuffix - lib:libvorbisenc$secondaryArchSuffix - lib:libvpx$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " - -PROVIDES_devel=" - ffmpeg${secondaryArchSuffix}_devel = $portVersion compat >= 0.10 - devel:libavcodec$secondaryArchSuffix = 53.61.100 compat >= 53 - devel:libavdevice$secondaryArchSuffix = 53.4.100 compat >= 53 - devel:libavfilter$secondaryArchSuffix = 2.61.100 compat >= 2 - devel:libavformat$secondaryArchSuffix = 53.32.100 compat >= 53 - devel:libavutil$secondaryArchSuffix = 51.35.100 compat >= 51 - devel:libpostproc$secondaryArchSuffix = 52.0.100 compat >= 52 - devel:libswresample$secondaryArchSuffix = 0.6.100 compat >= 0 - devel:libswscale$secondaryArchSuffix = 2.1.100 compat >= 2 - " -REQUIRES_devel=" - ffmpeg$secondaryArchSuffix == $portVersion - " - -BUILD_REQUIRES=" - devel:libbz2$secondaryArchSuffix - devel:libmodplug$secondaryArchSuffix - devel:libogg$secondaryArchSuffix - devel:libspeex$secondaryArchSuffix - devel:libtheora$secondaryArchSuffix - devel:libvorbis$secondaryArchSuffix - devel:libvpx$secondaryArchSuffix - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - haiku${secondaryArchSuffix}_devel - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:awk - cmd:make - cmd:perl - cmd:pkg_config$secondaryArchSuffix - cmd:texi2html - cmd:yasm - " - -GLOBAL_WRITABLE_FILES=" - settings/ffserver.conf - " - -PATCH() -{ - # patch hard-coded config file path - sed -i "s,/etc/ffserver.conf,$sysconfDir/ffserver.conf," \ - ffserver.c \ - doc/ffserver.texi - - # patch hard-coded paths to perl (used only during build so /system is fine) - sed -i "s,/usr/bin/perl,/system/bin/perl," \ - Doxyfile \ - doc/texi2pod.pl -} - -BUILD() -{ - # not an autotools configure - ./configure \ - --prefix=$prefix \ - --bindir=$binDir \ - --datadir=$dataDir/$portName \ - --incdir=$includeDir \ - --libdir=$libDir \ - --shlibdir=$libDir \ - --mandir=$manDir \ - --disable-debug \ - --enable-shared \ - --enable-libmodplug \ - --enable-libvorbis \ - --enable-libspeex \ - --enable-libtheora \ - --enable-libvpx \ - --enable-gpl - - make $jobArgs CFLAGS="-fno-PIC -std=gnu9x" -} - -INSTALL() -{ - make install - - prepareInstalledDevelLibs \ - libavcodec \ - libavdevice \ - libavfilter \ - libavformat \ - libavutil \ - libswresample \ - libswscale \ - libpostproc - fixPkgconfig - - # include the documented ffserver.conf - mkdir -p $docDir - cp doc/ffserver.conf $docDir - - # devel package - packageEntries devel \ - $developDir - - rm -rf $prefix/bin -} diff --git a/media-video/ffmpeg/ffmpeg_legacy-0.11.5.recipe b/media-video/ffmpeg/ffmpeg_legacy-0.11.5.recipe deleted file mode 100644 index 2049261e2c..0000000000 --- a/media-video/ffmpeg/ffmpeg_legacy-0.11.5.recipe +++ /dev/null @@ -1,166 +0,0 @@ -SUMMARY="Audio and video recording, conversion, and streaming library" -DESCRIPTION="FFmpeg is a complete, cross-platform solution to record, convert \ -and stream audio and video. It includes libavcodec - the leading audio/video \ -codec library." -HOMEPAGE="http://www.ffmpeg.org" -LICENSE="GNU LGPL v2.1 - GNU GPL v2" -COPYRIGHT="2000-2003 Fabrice Bellard - 2003-2014 the FFmpeg developers" -SOURCE_URI="http://www.ffmpeg.org/releases/ffmpeg-0.11.5.tar.bz2" -CHECKSUM_SHA256="9492991f44d6757080f457c0aef83e68884dbfb925666806c7f7ea0389e5b8c0" -REVISION="2" -SOURCE_DIR="ffmpeg-$portVersion" - -# It works for gcc2, but we have to disable ASM optimizations. Moreover, the -# 0.10.x series gets more updates, so the interest of switching to 0.11 is -# very uncertain (we get a somewhat newer API which we don't use, and older -# codecs). So let's keep it "broken" for now, until we have a good reason to -# use APIs introduced in 0.11. -ARCHITECTURES="!x86_gcc2 ?x86" -SECONDARY_ARCHITECTURES="!x86_gcc2 !x86" - -PATCHES="ffmpeg-0.11.5.patchset" - -PROVIDES=" - ffmpeg_legacy$secondaryArchSuffix = $portVersion compat >= 0.11 - lib:libavutil$secondaryArchSuffix = 51.54.100 compat >= 51 - lib:libavcodec$secondaryArchSuffix = 54.23.100 compat >= 54 - lib:libavformat$secondaryArchSuffix = 54.6.100 compat >= 54 - lib:libavdevice$secondaryArchSuffix = 54.0.100 compat >= 54 - lib:libavfilter$secondaryArchSuffix = 2.77.100 compat >= 2 - lib:libswscale$secondaryArchSuffix = 2.1.100 compat >= 2 - lib:libswresample$secondaryArchSuffix = 0.15.100 compat >= 0 - " - - -REQUIRES=" - haiku$secondaryArchSuffix - lib:libbz2$secondaryArchSuffix - lib:libogg$secondaryArchSuffix - lib:libspeex$secondaryArchSuffix - lib:libtheoradec$secondaryArchSuffix - lib:libtheoraenc$secondaryArchSuffix - lib:libvorbis$secondaryArchSuffix - lib:libvorbisenc$secondaryArchSuffix - lib:libvpx$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " - -PROVIDES_devel=" - ffmpeg_legacy${secondaryArchSuffix}_devel = $portVersion compat >= 0.11 - devel:libavutil$secondaryArchSuffix = 51.54.100 compat >= 51 - devel:libavcodec$secondaryArchSuffix = 54.23.100 compat >= 54 - devel:libavformat$secondaryArchSuffix = 54.6.100 compat >= 54 - devel:libavdevice$secondaryArchSuffix = 54.0.100 compat >= 54 - devel:libavfilter$secondaryArchSuffix = 2.77.100 compat >= 2 - devel:libswscale$secondaryArchSuffix = 2.1.100 compat >= 2 - devel:libswresample$secondaryArchSuffix = 0.15.100 compat >= 0 - " -REQUIRES_devel=" - ffmpeg_legacy$secondaryArchSuffix == $portVersion - " - -BUILD_REQUIRES=" - devel:libbz2$secondaryArchSuffix - devel:libbz2$secondaryArchSuffix - devel:libogg$secondaryArchSuffix - devel:libspeex$secondaryArchSuffix - devel:libtheora$secondaryArchSuffix - devel:libvorbis$secondaryArchSuffix - devel:libvpx$secondaryArchSuffix - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - haiku${secondaryArchSuffix}_devel - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:awk - cmd:cmp - cmd:make - cmd:perl - cmd:pkg_config$secondaryArchSuffix - cmd:texi2html - cmd:yasm - " - -GLOBAL_WRITABLE_FILES=" - settings/ffserver.conf - " - -PATCH() -{ - # patch hard-coded config file path - sed -i "s,/etc/ffserver.conf,$sysconfDir/ffserver.conf," \ - ffserver.c \ - doc/ffserver.texi - - # patch hard-coded paths to perl (used during build only) - sed -i "s,/usr/bin/perl,/system/bin/perl," \ - Doxyfile \ - doc/texi2pod.pl -} - -BUILD() -{ - if [ "$effectiveTargetArchitecture" == "x86_gcc2" ]; then - extra_flags="--disable-asm --disable-stripping" - else - extra_flags="--disable-amd3dnow --disable-optimizations --disable-stripping \ - --disable-decoder=rv30 --disable-decoder=rv40 --disable-decoder=svq3 \ - --disable-decoder=vp8 --disable-decoder=h264 --disable-parser=h264 \ - --disable-decoder=h263" - fi - - # not an autotools configure - ./configure \ - --prefix=$prefix \ - --bindir=$prefix/bin \ - --datadir=$dataDir/$portName \ - --incdir=$includeDir \ - --libdir=$libDir \ - --shlibdir=$libDir \ - --mandir=$manDir \ - --disable-debug \ - --enable-shared \ - --enable-libvorbis \ - --enable-libspeex \ - --enable-libtheora \ - --enable-libvpx \ - $extra_flags - - if [ "$effectiveTargetArchitecture" == "x86_64" ]; then - pic=-fPIC - else - pic=-fno-PIC - fi - make $jobArgs CFLAGS="$pic -std=gnu9x -g" -} - -INSTALL() -{ - make install - if [ "$effectiveTargetArchitecture" == "x86_gcc2" ]; then - rm -rf $prefix/bin - fi - - prepareInstalledDevelLibs \ - libavcodec \ - libavdevice \ - libavfilter \ - libavformat \ - libavutil \ - libswresample \ - libswscale - fixPkgconfig - - # include the documented ffserver.conf - mkdir -p $docDir - cp doc/ffserver.conf $docDir - - # devel package - packageEntries devel \ - $developDir - - rm -rf $prefix/bin -} diff --git a/media-video/ffmpeg/patches/ffmpeg-0.10.14.patchset b/media-video/ffmpeg/patches/ffmpeg-0.10.14.patchset deleted file mode 100644 index 79cc984b68..0000000000 --- a/media-video/ffmpeg/patches/ffmpeg-0.10.14.patchset +++ /dev/null @@ -1,1604 +0,0 @@ -From 82433d76e8b154ae8b47aadf3d4b9ea1c904c9ac Mon Sep 17 00:00:00 2001 -From: Adrien Destugues -Date: Sun, 30 Aug 2015 13:15:31 +0200 -Subject: applying patch ffmpeg-0.10.14-gcc2.patch - - -diff --git a/cmdutils.c b/cmdutils.c -index 01abc51..ea73b8c 100644 ---- a/cmdutils.c -+++ b/cmdutils.c -@@ -89,7 +89,7 @@ static void log_callback_report(void *ptr, int level, const char *fmt, va_list v - char line[1024]; - static int print_prefix = 1; - -- va_copy(vl2, vl); -+ __va_copy(vl2, vl); - av_log_default_callback(ptr, level, fmt, vl); - av_log_format_line(ptr, level, fmt, vl2, line, sizeof(line), &print_prefix); - va_end(vl2); -diff --git a/configure b/configure -index b65cefe..8c6b676 100755 ---- a/configure -+++ b/configure -@@ -1369,7 +1369,6 @@ avx_deps="ssse3" - - aligned_stack_if_any="ppc x86" - fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64" --fast_clz_if_any="alpha armv5te avr32 mips ppc x86" - fast_unaligned_if_any="armv6 ppc x86" - - inline_asm_deps="!tms470" -@@ -1876,7 +1875,7 @@ AS_O='-o $@' - CC_O='-o $@' - CXX_O='-o $@' - --host_cflags='-D_ISOC99_SOURCE -O3 -g' -+host_cflags='-D_ISOC99_SOURCE -O2 -g' - host_libs='-lm' - - target_path='$(CURDIR)' -@@ -1958,6 +1957,7 @@ for n in $COMPONENT_LIST; do - done - - enable $ARCH_EXT_LIST $ALL_TESTS -+disable sse - - die_unknown(){ - echo "Unknown option \"$1\"." -@@ -2154,7 +2154,7 @@ elif $cc -v 2>&1 | grep -qi ^gcc; then - CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' - AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' - fi -- speed_cflags='-O3' -+ speed_cflags='-O2' - size_cflags='-Os' - elif $cc --version 2>/dev/null | grep -q Intel; then - cc_type=icc -@@ -2841,10 +2841,6 @@ check_cc <fifo) / (enc->channels * osize); // FIXME wrong - - if (ost->audio_resample) { -+ uint8_t *buftmp2[] = { buftmp }; -+ const uint8_t *buf2[] = { buf }; - buftmp = audio_buf; -- size_out = swr_convert(ost->swr, ( uint8_t*[]){buftmp}, audio_buf_size / (enc->channels * osize), -- (const uint8_t*[]){buf }, size / (dec->channels * isize)); -+ size_out = swr_convert(ost->swr, buftmp2, audio_buf_size / (enc->channels * osize), -+ buf2, size / (dec->channels * isize)); - size_out = size_out * enc->channels * osize; - } else { - buftmp = buf; -diff --git a/ffprobe.c b/ffprobe.c -index 48c813a..be3d3ad 100644 ---- a/ffprobe.c -+++ b/ffprobe.c -@@ -293,7 +293,9 @@ static void writer_print_time(WriterContext *wctx, const char *key, - writer_print_string(wctx, key, "N/A", 1); - } else { - double d = ts * av_q2d(*time_base); -- value_string(buf, sizeof(buf), (struct unit_value){.val.d=d, .unit=unit_second_str}); -+ struct unit_value value2 = {.unit=unit_second_str}; -+ value2.val.d = d; -+ value_string(buf, sizeof(buf), value2); - writer_print_string(wctx, key, buf, 0); - } - } -@@ -1249,8 +1251,8 @@ static void writer_register_all(void) - #define print_str_opt(k, v) writer_print_string(w, k, v, 1) - #define print_time(k, v, tb) writer_print_time(w, k, v, tb) - #define print_ts(k, v) writer_print_ts(w, k, v) --#define print_val(k, v, u) writer_print_string(w, k, \ -- value_string(val_str, sizeof(val_str), (struct unit_value){.val.i = v, .unit=u}), 0) -+#define print_val(k, v, u) value2.val.i = v; value2.unit=u; writer_print_string(w, k, \ -+ value_string(val_str, sizeof(val_str), value2), 0); - #define print_section_header(s) writer_print_section_header(w, s) - #define print_section_footer(s) writer_print_section_footer(w, s) - #define show_tags(metadata) writer_show_tags(w, metadata) -@@ -1261,6 +1263,7 @@ static void show_packet(WriterContext *w, AVFormatContext *fmt_ctx, AVPacket *pk - AVStream *st = fmt_ctx->streams[pkt->stream_index]; - struct print_buf pbuf = {.s = NULL}; - const char *s; -+ struct unit_value value2; - - print_section_header("packet"); - s = av_get_media_type_string(st->codec->codec_type); -@@ -1404,6 +1407,7 @@ static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_i - const char *s; - AVRational display_aspect_ratio; - struct print_buf pbuf = {.s = NULL}; -+ struct unit_value value2; - - print_section_header("stream"); - -@@ -1516,6 +1520,7 @@ static void show_format(WriterContext *w, AVFormatContext *fmt_ctx) - { - char val_str[128]; - int64_t size = fmt_ctx->pb ? avio_size(fmt_ctx->pb) : -1; -+ struct unit_value value2; - - print_section_header("format"); - print_str("filename", fmt_ctx->filename); -@@ -1524,9 +1529,9 @@ static void show_format(WriterContext *w, AVFormatContext *fmt_ctx) - print_str("format_long_name", fmt_ctx->iformat->long_name); - print_time("start_time", fmt_ctx->start_time, &AV_TIME_BASE_Q); - print_time("duration", fmt_ctx->duration, &AV_TIME_BASE_Q); -- if (size >= 0) print_val ("size", size, unit_byte_str); -+ if (size >= 0) { print_val ("size", size, unit_byte_str); } - else print_str_opt("size", "N/A"); -- if (fmt_ctx->bit_rate > 0) print_val ("bit_rate", fmt_ctx->bit_rate, unit_bit_per_second_str); -+ if (fmt_ctx->bit_rate > 0) { print_val ("bit_rate", fmt_ctx->bit_rate, unit_bit_per_second_str); } - else print_str_opt("bit_rate", "N/A"); - show_tags(fmt_ctx->metadata); - print_section_footer("format"); -diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c -index 2ff6f9c..344fbd4 100644 ---- a/libavcodec/aacenc.c -+++ b/libavcodec/aacenc.c -@@ -223,8 +223,9 @@ WINDOW_FUNC(eight_short) - const float *pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128; - const float *in = audio + 448; - float *out = sce->ret; -+ int w; - -- for (int w = 0; w < 8; w++) { -+ for (w = 0; w < 8; w++) { - dsp->vector_fmul (out, in, w ? pwindow : swindow, 128); - out += 128; - in += 128; -@@ -686,11 +687,12 @@ static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s) - - static av_cold int alloc_buffers(AVCodecContext *avctx, AACEncContext *s) - { -+ int ch; - FF_ALLOCZ_OR_GOTO(avctx, s->buffer.samples, 3 * 1024 * s->channels * sizeof(s->buffer.samples[0]), alloc_fail); - FF_ALLOCZ_OR_GOTO(avctx, s->cpe, sizeof(ChannelElement) * s->chan_map[0], alloc_fail); - FF_ALLOCZ_OR_GOTO(avctx, avctx->extradata, 5 + FF_INPUT_BUFFER_PADDING_SIZE, alloc_fail); - -- for(int ch = 0; ch < s->channels; ch++) -+ for(ch = 0; ch < s->channels; ch++) - s->planar_samples[ch] = s->buffer.samples + 3 * 1024 * ch; - - return 0; -diff --git a/libavcodec/ac3dsp.c b/libavcodec/ac3dsp.c -index 581e5f5..cf7dedc 100644 ---- a/libavcodec/ac3dsp.c -+++ b/libavcodec/ac3dsp.c -@@ -228,8 +228,10 @@ av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact) - c->sum_square_butterfly_int32 = ac3_sum_square_butterfly_int32_c; - c->sum_square_butterfly_float = ac3_sum_square_butterfly_float_c; - -- if (ARCH_ARM) -+#if ARCH_ARM - ff_ac3dsp_init_arm(c, bit_exact); -- if (HAVE_MMX) -+#endif -+#if HAVE_MMX - ff_ac3dsp_init_x86(c, bit_exact); -+#endif - } -diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c -index 32f3f52..970c5ed 100644 ---- a/libavcodec/allcodecs.c -+++ b/libavcodec/allcodecs.c -@@ -54,6 +54,7 @@ void avcodec_register_all(void) - initialized = 1; - - /* hardware accelerators */ -+#if 0 - REGISTER_HWACCEL (H263_VAAPI, h263_vaapi); - REGISTER_HWACCEL (H264_DXVA2, h264_dxva2); - REGISTER_HWACCEL (H264_VAAPI, h264_vaapi); -@@ -67,6 +68,7 @@ void avcodec_register_all(void) - REGISTER_HWACCEL (VC1_VAAPI, vc1_vaapi); - REGISTER_HWACCEL (WMV3_DXVA2, wmv3_dxva2); - REGISTER_HWACCEL (WMV3_VAAPI, wmv3_vaapi); -+#endif - - /* video codecs */ - REGISTER_ENCODER (A64MULTI, a64multi); -@@ -126,8 +128,10 @@ void avcodec_register_all(void) - REGISTER_DECODER (H263I, h263i); - REGISTER_ENCODER (H263P, h263p); - REGISTER_DECODER (H264, h264); -+#ifndef __HAIKU__ - REGISTER_DECODER (H264_CRYSTALHD, h264_crystalhd); - REGISTER_DECODER (H264_VDPAU, h264_vdpau); -+#endif - REGISTER_ENCDEC (HUFFYUV, huffyuv); - REGISTER_DECODER (IDCIN, idcin); - REGISTER_DECODER (IFF_BYTERUN1, iff_byterun1); -diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c -index 89d023b..cd99900 100644 ---- a/libavcodec/apedec.c -+++ b/libavcodec/apedec.c -@@ -133,6 +133,7 @@ typedef struct APEContext { - DSPContext dsp; - int channels; - int samples; ///< samples left to decode in current frame -+ int bps; - - int fileversion; ///< codec version, very important in decoding process - int compression_level; ///< compression levels -@@ -183,14 +184,26 @@ static av_cold int ape_decode_init(AVCodecContext *avctx) - av_log(avctx, AV_LOG_ERROR, "Incorrect extradata\n"); - return AVERROR(EINVAL); - } -- if (avctx->bits_per_coded_sample != 16) { -- av_log(avctx, AV_LOG_ERROR, "Only 16-bit samples are supported\n"); -- return AVERROR(EINVAL); -- } - if (avctx->channels > 2) { - av_log(avctx, AV_LOG_ERROR, "Only mono and stereo is supported\n"); - return AVERROR(EINVAL); - } -+ s->bps = avctx->bits_per_coded_sample; -+ switch(s->bps) { -+ case 8: -+ avctx->sample_fmt = AV_SAMPLE_FMT_U8; -+ break; -+ case 0: -+ case 16: -+ avctx->sample_fmt = AV_SAMPLE_FMT_S16; -+ break; -+ case 24: -+ avctx->sample_fmt = AV_SAMPLE_FMT_S32; -+ break; -+ default: -+ av_log_ask_for_sample(avctx, "Unsupported bits per decoded sample %d\n", s->bps); -+ return AVERROR_PATCHWELCOME; -+ } - s->avctx = avctx; - s->channels = avctx->channels; - s->fileversion = AV_RL16(avctx->extradata); -@@ -214,7 +227,6 @@ static av_cold int ape_decode_init(AVCodecContext *avctx) - } - - dsputil_init(&s->dsp, avctx); -- avctx->sample_fmt = AV_SAMPLE_FMT_S16; - avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO; - - avcodec_get_frame_defaults(&s->frame); -@@ -819,7 +831,9 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data, - const uint8_t *buf = avpkt->data; - int buf_size = avpkt->size; - APEContext *s = avctx->priv_data; -- int16_t *samples; -+ uint8_t *samples8; -+ int16_t *samples16; -+ int32_t *samples24; - int i, ret; - int blockstodecode; - -@@ -891,7 +905,6 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data, - av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); - return ret; - } -- samples = (int16_t *)s->frame.data[0]; - - s->error=0; - -@@ -907,11 +920,32 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data, - return AVERROR_INVALIDDATA; - } - -- for (i = 0; i < blockstodecode; i++) { -- *samples++ = s->decoded0[i]; -- if(s->channels == 2) -- *samples++ = s->decoded1[i]; -- } -+ switch(s->bps) { -+ case 8: -+ samples8 = (uint8_t*)s->frame.data[0]; -+ for (i = 0; i < blockstodecode; i++) { -+ *samples8++ = (s->decoded0[i] + 0x80) & 0xff; -+ if (s->channels == 2) -+ *samples8++ = (s->decoded1[i] + 0x80) & 0xff; -+ } -+ break; -+ case 16: -+ samples16 = (int16_t*)s->frame.data[0]; -+ for (i = 0; i < blockstodecode; i++) { -+ *samples16++ = s->decoded0[i]; -+ if (s->channels == 2) -+ *samples16++ = s->decoded1[i]; -+ } -+ break; -+ case 24: -+ samples24 = (int32_t*)s->frame.data[0]; -+ for (i = 0; i < blockstodecode; i++) { -+ *samples24++ = s->decoded0[i] << 8; -+ if (s->channels == 2) -+ *samples24++ = s->decoded1[i] << 8; -+ } -+ break; -+ } - - s->samples -= blockstodecode; - -diff --git a/libavcodec/dcadsp.c b/libavcodec/dcadsp.c -index dd4994d..7a980a1 100644 ---- a/libavcodec/dcadsp.c -+++ b/libavcodec/dcadsp.c -@@ -47,5 +47,7 @@ static void dca_lfe_fir_c(float *out, const float *in, const float *coefs, - void ff_dcadsp_init(DCADSPContext *s) - { - s->lfe_fir = dca_lfe_fir_c; -- if (ARCH_ARM) ff_dcadsp_init_arm(s); -+#if ARCH_ARM -+ ff_dcadsp_init_arm(s); -+#endif - } -diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c -index dab74cc..0d6d2d0 100644 ---- a/libavcodec/dsputil.c -+++ b/libavcodec/dsputil.c -@@ -3174,15 +3174,31 @@ av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx) - } - - -- if (HAVE_MMX) dsputil_init_mmx (c, avctx); -- if (ARCH_ARM) dsputil_init_arm (c, avctx); -- if (CONFIG_MLIB) dsputil_init_mlib (c, avctx); -- if (HAVE_VIS) dsputil_init_vis (c, avctx); -- if (ARCH_ALPHA) dsputil_init_alpha (c, avctx); -- if (ARCH_PPC) dsputil_init_ppc (c, avctx); -- if (HAVE_MMI) dsputil_init_mmi (c, avctx); -- if (ARCH_SH4) dsputil_init_sh4 (c, avctx); -- if (ARCH_BFIN) dsputil_init_bfin (c, avctx); -+#if HAVE_MMX -+ dsputil_init_mmx (c, avctx); -+#endif -+#if ARCH_ARM -+ dsputil_init_arm (c, avctx); -+#endif -+#if CONFIG_MLIB -+ dsputil_init_mlib (c, avctx); -+#endif -+#if HAVE_VIS -+ dsputil_init_vis (c, avctx); -+#endif -+#if ARCH_ALPHA -+ dsputil_init_alpha (c, avctx); -+#elif ARCH_PPC -+ dsputil_init_ppc (c, avctx); -+#endif -+#if HAVE_MMI -+ dsputil_init_mmi (c, avctx); -+#endif -+#if ARCH_SH4 -+ dsputil_init_sh4 (c, avctx); -+#elif ARCH_BFIN -+ dsputil_init_bfin (c, avctx); -+#endif - - for (i = 0; i < 4; i++) { - for (j = 0; j < 16; j++) { -diff --git a/libavcodec/fft.c b/libavcodec/fft.c -index 4eb46f1..6197bd0 100644 ---- a/libavcodec/fft.c -+++ b/libavcodec/fft.c -@@ -158,13 +158,21 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse) - #endif - - #if CONFIG_FFT_FLOAT -- if (ARCH_ARM) ff_fft_init_arm(s); -- if (HAVE_ALTIVEC) ff_fft_init_altivec(s); -- if (HAVE_MMX) ff_fft_init_mmx(s); -+#if ARCH_ARM -+ ff_fft_init_arm(s); -+#endif -+#if HAVE_ALTIVEC -+ ff_fft_init_altivec(s); -+#endif -+#if HAVE_MMX -+ ff_fft_init_mmx(s); -+#endif - if (CONFIG_MDCT) s->mdct_calcw = s->mdct_calc; - #else - if (CONFIG_MDCT) s->mdct_calcw = ff_mdct_calcw_c; -- if (ARCH_ARM) ff_fft_fixed_init_arm(s); -+#if ARCH_ARM -+ ff_fft_fixed_init_arm(s); -+#endif - #endif - - for(j=4; j<=nbits; j++) { -diff --git a/libavcodec/fmtconvert.c b/libavcodec/fmtconvert.c -index c03117c..037bdf5 100644 ---- a/libavcodec/fmtconvert.c -+++ b/libavcodec/fmtconvert.c -@@ -82,9 +82,15 @@ av_cold void ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx) - c->float_to_int16_interleave = float_to_int16_interleave_c; - c->float_interleave = ff_float_interleave_c; - -- if (ARCH_ARM) ff_fmt_convert_init_arm(c, avctx); -- if (HAVE_ALTIVEC) ff_fmt_convert_init_altivec(c, avctx); -- if (HAVE_MMX) ff_fmt_convert_init_x86(c, avctx); -+#if ARCH_ARM -+ ff_fmt_convert_init_arm(c, avctx); -+#endif -+#if HAVE_ALTIVEC -+ ff_fmt_convert_init_altivec(c, avctx); -+#endif -+#if HAVE_MMX -+ ff_fmt_convert_init_x86(c, avctx); -+#endif - } - - /* ffdshow custom code */ -diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c -index 07fa430..0e3b2d9 100644 ---- a/libavcodec/h263dec.c -+++ b/libavcodec/h263dec.c -@@ -643,10 +643,12 @@ retry: - - if (!s->divx_packed) ff_thread_finish_setup(avctx); - -- if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)) { -+#if CONFIG_MPEG4_VDPAU_DECODER -+ if ((s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)) { - ff_vdpau_mpeg4_decode_picture(s, s->gb.buffer, s->gb.buffer_end - s->gb.buffer); - goto frame_end; - } -+#endif - - if (avctx->hwaccel) { - if (avctx->hwaccel->start_frame(avctx, s->gb.buffer, s->gb.buffer_end - s->gb.buffer) < 0) -diff --git a/libavcodec/h264.c b/libavcodec/h264.c -index 981adb4..3315ff4 100644 ---- a/libavcodec/h264.c -+++ b/libavcodec/h264.c -@@ -2509,8 +2509,10 @@ static int field_end(H264Context *h, int in_setup){ - ff_thread_report_progress(&s->current_picture_ptr->f, INT_MAX, - s->picture_structure == PICT_BOTTOM_FIELD); - -- if (CONFIG_H264_VDPAU_DECODER && s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU) -+#if CONFIG_H264_VDPAU_DECODER -+ if (s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU) - ff_vdpau_h264_set_reference_frames(s); -+#endif - - if(in_setup || !(avctx->active_thread_type&FF_THREAD_FRAME)){ - if(!s->dropable) { -@@ -2528,8 +2530,10 @@ static int field_end(H264Context *h, int in_setup){ - av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n"); - } - -- if (CONFIG_H264_VDPAU_DECODER && s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU) -+#if CONFIG_H264_VDPAU_DECODER -+ if (s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU) - ff_vdpau_h264_picture_complete(s); -+#endif - - /* - * FIXME: Error handling code does not seem to support interlaced -@@ -4085,8 +4089,10 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){ - - if (s->avctx->hwaccel && s->avctx->hwaccel->start_frame(s->avctx, NULL, 0) < 0) - return -1; -- if(CONFIG_H264_VDPAU_DECODER && s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU) -+#if CONFIG_H264_VDPAU_DECODER -+ if(s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU) - ff_vdpau_h264_picture_start(s); -+#endif - } - - if(hx->redundant_pic_count==0 -@@ -4098,11 +4104,13 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){ - if (avctx->hwaccel->decode_slice(avctx, &buf[buf_index - consumed], consumed) < 0) - return -1; - }else -- if(CONFIG_H264_VDPAU_DECODER && s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU){ -+#if CONFIG_H264_VDPAU_DECODER -+ if(s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU){ - static const uint8_t start_code[] = {0x00, 0x00, 0x01}; - ff_vdpau_add_data_chunk(s, start_code, sizeof(start_code)); - ff_vdpau_add_data_chunk(s, &buf[buf_index - consumed], consumed ); - }else -+#endif - context_count++; - } - break; -diff --git a/libavcodec/h264dsp.c b/libavcodec/h264dsp.c -index eeee6a2..5340347 100644 ---- a/libavcodec/h264dsp.c -+++ b/libavcodec/h264dsp.c -@@ -111,7 +111,13 @@ void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, const int chroma_fo - break; - } - -- if (ARCH_ARM) ff_h264dsp_init_arm(c, bit_depth, chroma_format_idc); -- if (HAVE_ALTIVEC) ff_h264dsp_init_ppc(c, bit_depth, chroma_format_idc); -- if (HAVE_MMX) ff_h264dsp_init_x86(c, bit_depth, chroma_format_idc); -+#if ARCH_ARM -+ ff_h264dsp_init_arm(c, bit_depth, chroma_format_idc); -+#endif -+#if HAVE_ALTIVEC -+ ff_h264dsp_init_ppc(c, bit_depth, chroma_format_idc); -+#endif -+#if HAVE_MMX -+ ff_h264dsp_init_x86(c, bit_depth, chroma_format_idc); -+#endif - } -diff --git a/libavcodec/h264pred.c b/libavcodec/h264pred.c -index e3efdf9..be57d63 100644 ---- a/libavcodec/h264pred.c -+++ b/libavcodec/h264pred.c -@@ -532,6 +532,10 @@ void ff_h264_pred_init(H264PredContext *h, int codec_id, const int bit_depth, co - break; - } - -- if (ARCH_ARM) ff_h264_pred_init_arm(h, codec_id, bit_depth, chroma_format_idc); -- if (HAVE_MMX) ff_h264_pred_init_x86(h, codec_id, bit_depth, chroma_format_idc); -+#if ARCH_ARM -+ ff_h264_pred_init_arm(h, codec_id, bit_depth, chroma_format_idc); -+#endif -+#if HAVE_MMX -+ ff_h264_pred_init_x86(h, codec_id, bit_depth, chroma_format_idc); -+#endif - } -diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c -index 58456a6..8e0568e 100644 ---- a/libavcodec/mpeg12.c -+++ b/libavcodec/mpeg12.c -@@ -843,12 +843,14 @@ static int mpeg_decode_mb(MpegEncContext *s, DCTELEM block[12][64]) - memset(s->last_mv, 0, sizeof(s->last_mv)); /* reset mv prediction */ - s->mb_intra = 1; - // if 1, we memcpy blocks in xvmcvideo -- if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1) { -+#if CONFIG_MPEG_XVMC_DECODER -+ if (s->avctx->xvmc_acceleration > 1) { - ff_xvmc_pack_pblocks(s, -1); // inter are always full blocks - if (s->swap_uv) { - exchange_uv(s); - } - } -+#endif - - if (s->codec_id == CODEC_ID_MPEG2VIDEO) { - if (s->flags2 & CODEC_FLAG2_FAST) { -@@ -1061,12 +1063,14 @@ static int mpeg_decode_mb(MpegEncContext *s, DCTELEM block[12][64]) - } - - //if 1, we memcpy blocks in xvmcvideo -- if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1) { -+#if CONFIG_MPEG_XVMC_DECODER -+ if (s->avctx->xvmc_acceleration > 1) { - ff_xvmc_pack_pblocks(s, cbp); - if (s->swap_uv) { - exchange_uv(s); - } - } -+#endif - - if (s->codec_id == CODEC_ID_MPEG2VIDEO) { - if (s->flags2 & CODEC_FLAG2_FAST) { -@@ -1654,9 +1658,11 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) - - // MPV_frame_start will call this function too, - // but we need to call it on every field -- if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) -+#if CONFIG_MPEG_XVMC_DECODER -+ if (s->avctx->xvmc_acceleration) - if (ff_xvmc_field_start(s, avctx) < 0) - return -1; -+#endif - - return 0; - } -@@ -1758,8 +1764,10 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y, - - for (;;) { - // If 1, we memcpy blocks in xvmcvideo. -- if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1) -+#if CONFIG_MPEG_XVMC_DECODER -+ if (s->avctx->xvmc_acceleration > 1) - ff_xvmc_init_block(s); // set s->block -+#endif - - if (mpeg_decode_mb(s, s->block) < 0) - return -1; -@@ -1947,8 +1955,10 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict) - av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n"); - } - -- if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) -+#if CONFIG_MPEG_XVMC_DECODER -+ if (s->avctx->xvmc_acceleration) - ff_xvmc_field_end(s); -+#endif - - /* end of slice reached */ - if (/*s->mb_y << field_pic == s->mb_height &&*/ !s->first_field && !s->first_slice) { -diff --git a/libavcodec/mpegaudiodsp.c b/libavcodec/mpegaudiodsp.c -index cc12dd9..b7b95fd 100644 ---- a/libavcodec/mpegaudiodsp.c -+++ b/libavcodec/mpegaudiodsp.c -@@ -40,7 +40,13 @@ void ff_mpadsp_init(MPADSPContext *s) - s->imdct36_blocks_float = ff_imdct36_blocks_float; - s->imdct36_blocks_fixed = ff_imdct36_blocks_fixed; - -- if (ARCH_ARM) ff_mpadsp_init_arm(s); -- if (HAVE_MMX) ff_mpadsp_init_mmx(s); -- if (HAVE_ALTIVEC) ff_mpadsp_init_altivec(s); -+#if ARCH_ARM -+ ff_mpadsp_init_arm(s); -+#endif -+#if HAVE_MMX -+ ff_mpadsp_init_mmx(s); -+#endif -+#if HAVE_ALTIVEC -+ ff_mpadsp_init_altivec(s); -+#endif - } -diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c -index 9bb862a..0bedbeb 100644 ---- a/libavcodec/mpegvideo.c -+++ b/libavcodec/mpegvideo.c -@@ -1330,8 +1330,10 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) - update_noise_reduction(s); - } - -- if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) -+#if CONFIG_MPEG_XVMC_DECODER -+ if (s->avctx->xvmc_acceleration) - return ff_xvmc_field_start(s, avctx); -+#endif - - return 0; - } -@@ -1343,9 +1345,12 @@ void MPV_frame_end(MpegEncContext *s) - int i; - /* redraw edges for the frame if decoding didn't complete */ - // just to make sure that all data is rendered. -+#if CONFIG_MPEG_XVMC_DECODER - if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) { - ff_xvmc_field_end(s); -- } else if((s->error_count || s->encoding || !(s->avctx->codec->capabilities&CODEC_CAP_DRAW_HORIZ_BAND)) && -+ } else -+#endif -+ if((s->error_count || s->encoding || !(s->avctx->codec->capabilities&CODEC_CAP_DRAW_HORIZ_BAND)) && - !s->avctx->hwaccel && - !(s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) && - s->unrestricted_mv && -diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c -index d36914a..103b742 100644 ---- a/libavcodec/pngenc.c -+++ b/libavcodec/pngenc.c -@@ -54,8 +54,9 @@ static void png_get_interlaced_row(uint8_t *dst, int row_size, - int x, mask, dst_x, j, b, bpp; - uint8_t *d; - const uint8_t *s; -- -- mask = (int[]){0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}[pass]; -+ int mask_tmp[] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}; -+ -+ mask = mask_tmp[pass]; - switch(bits_per_pixel) { - case 1: - memset(dst, 0, row_size); -diff --git a/libavcodec/rdft.c b/libavcodec/rdft.c -index ebddd8b..66918f9 100644 ---- a/libavcodec/rdft.c -+++ b/libavcodec/rdft.c -@@ -122,7 +122,9 @@ av_cold int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans) - #endif - s->rdft_calc = ff_rdft_calc_c; - -- if (ARCH_ARM) ff_rdft_init_arm(s); -+#if ARCH_ARM -+ ff_rdft_init_arm(s); -+#endif - - return 0; - } -diff --git a/libavcodec/rv34dsp.c b/libavcodec/rv34dsp.c -index 919703d..4f4918d 100644 ---- a/libavcodec/rv34dsp.c -+++ b/libavcodec/rv34dsp.c -@@ -134,8 +134,10 @@ av_cold void ff_rv34dsp_init(RV34DSPContext *c, DSPContext* dsp) { - c->rv34_idct_add = rv34_idct_add_c; - c->rv34_idct_dc_add = rv34_idct_dc_add_c; - -- if (HAVE_NEON) -+#if HAVE_NEON - ff_rv34dsp_init_neon(c, dsp); -- if (HAVE_MMX) -+#endif -+#if HAVE_MMX - ff_rv34dsp_init_x86(c, dsp); -+#endif - } -diff --git a/libavcodec/rv40dsp.c b/libavcodec/rv40dsp.c -index 913ced0..e16f1e6 100644 ---- a/libavcodec/rv40dsp.c -+++ b/libavcodec/rv40dsp.c -@@ -588,8 +588,10 @@ av_cold void ff_rv40dsp_init(RV34DSPContext *c, DSPContext* dsp) { - c->rv40_loop_filter_strength[0] = rv40_h_loop_filter_strength; - c->rv40_loop_filter_strength[1] = rv40_v_loop_filter_strength; - -- if (HAVE_MMX) -+#if HAVE_MMX - ff_rv40dsp_init_x86(c, dsp); -- if (HAVE_NEON) -+#endif -+#if HAVE_NEON - ff_rv40dsp_init_neon(c, dsp); -+#endif - } -diff --git a/libavcodec/synth_filter.c b/libavcodec/synth_filter.c -index 5f10530..1009c53 100644 ---- a/libavcodec/synth_filter.c -+++ b/libavcodec/synth_filter.c -@@ -60,5 +60,7 @@ av_cold void ff_synth_filter_init(SynthFilterContext *c) - { - c->synth_filter_float = synth_filter_float; - -- if (ARCH_ARM) ff_synth_filter_init_arm(c); -+#if ARCH_ARM -+ ff_synth_filter_init_arm(c); -+#endif - } -diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c -index 5f745ad..849ab69 100644 ---- a/libavcodec/vc1dec.c -+++ b/libavcodec/vc1dec.c -@@ -5571,10 +5571,12 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, - s->me.qpel_put = s->dsp.put_qpel_pixels_tab; - s->me.qpel_avg = s->dsp.avg_qpel_pixels_tab; - -- if ((CONFIG_VC1_VDPAU_DECODER) -- &&s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU) -+#if CONFIG_VC1_VDPAU_DECODER -+ if (s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU) - ff_vdpau_vc1_decode_picture(s, buf_start, (buf + buf_size) - buf_start); -- else if (avctx->hwaccel) { -+ else -+#endif -+ if (avctx->hwaccel) { - if (avctx->hwaccel->start_frame(avctx, buf, buf_size) < 0) - goto err; - if (avctx->hwaccel->decode_slice(avctx, buf_start, (buf + buf_size) - buf_start) < 0) -diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c -index da7593f..38a28aa 100644 ---- a/libavcodec/vc1dsp.c -+++ b/libavcodec/vc1dsp.c -@@ -846,8 +846,10 @@ av_cold void ff_vc1dsp_init(VC1DSPContext* dsp) { - dsp->sprite_v_double_twoscale = sprite_v_double_twoscale_c; - #endif - -- if (HAVE_ALTIVEC) -+#if (HAVE_ALTIVEC) - ff_vc1dsp_init_altivec(dsp); -- if (HAVE_MMX) -+#endif -+#if (HAVE_MMX) - ff_vc1dsp_init_mmx(dsp); -+#endif - } -diff --git a/libavcodec/vp56dsp.c b/libavcodec/vp56dsp.c -index c629343..782bb39 100644 ---- a/libavcodec/vp56dsp.c -+++ b/libavcodec/vp56dsp.c -@@ -88,6 +88,10 @@ void ff_vp56dsp_init(VP56DSPContext *s, enum CodecID codec) - } - } - -- if (ARCH_ARM) ff_vp56dsp_init_arm(s, codec); -- if (HAVE_MMX) ff_vp56dsp_init_x86(s, codec); -+#if ARCH_ARM -+ ff_vp56dsp_init_arm(s, codec); -+#endif -+#if HAVE_MMX -+ ff_vp56dsp_init_x86(s, codec); -+#endif - } -diff --git a/libavcodec/vp8dsp.c b/libavcodec/vp8dsp.c -index af46b28..8f7564e 100644 ---- a/libavcodec/vp8dsp.c -+++ b/libavcodec/vp8dsp.c -@@ -520,10 +520,13 @@ av_cold void ff_vp8dsp_init(VP8DSPContext *dsp) - VP8_BILINEAR_MC_FUNC(1, 8); - VP8_BILINEAR_MC_FUNC(2, 4); - -- if (HAVE_MMX) -+#if (HAVE_MMX) - ff_vp8dsp_init_x86(dsp); -- if (HAVE_ALTIVEC) -+#endif -+#if (HAVE_ALTIVEC) - ff_vp8dsp_init_altivec(dsp); -- if (ARCH_ARM) -+#endif -+#if (ARCH_ARM) - ff_vp8dsp_init_arm(dsp); -+#endif - } -diff --git a/libavcodec/x86/ac3dsp_mmx.c b/libavcodec/x86/ac3dsp_mmx.c -index df5e77a..ea66b43 100644 ---- a/libavcodec/x86/ac3dsp_mmx.c -+++ b/libavcodec/x86/ac3dsp_mmx.c -@@ -57,20 +57,25 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact) - c->ac3_lshift_int16 = ff_ac3_lshift_int16_mmx; - c->ac3_rshift_int32 = ff_ac3_rshift_int32_mmx; - } -- if (mm_flags & AV_CPU_FLAG_3DNOW && HAVE_AMD3DNOW) { -+#if HAVE_AMD3DNOW -+ if (mm_flags & AV_CPU_FLAG_3DNOW) { - c->extract_exponents = ff_ac3_extract_exponents_3dnow; - if (!bit_exact) { - c->float_to_fixed24 = ff_float_to_fixed24_3dnow; - } - } -- if (mm_flags & AV_CPU_FLAG_MMX2 && HAVE_MMX2) { -+#endif -+#if HAVE_MMX2 -+ if (mm_flags & AV_CPU_FLAG_MMX2) { - c->ac3_exponent_min = ff_ac3_exponent_min_mmxext; - c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_mmxext; - } -- if (mm_flags & AV_CPU_FLAG_SSE && HAVE_SSE) { -+#endif -+#if HAVE_SSE -+ if (mm_flags & AV_CPU_FLAG_SSE) { - c->float_to_fixed24 = ff_float_to_fixed24_sse; - } -- if (mm_flags & AV_CPU_FLAG_SSE2 && HAVE_SSE) { -+ if (mm_flags & AV_CPU_FLAG_SSE2) { - c->ac3_exponent_min = ff_ac3_exponent_min_sse2; - c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_sse2; - c->float_to_fixed24 = ff_float_to_fixed24_sse2; -@@ -81,11 +86,14 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact) - c->ac3_rshift_int32 = ff_ac3_rshift_int32_sse2; - } - } -- if (mm_flags & AV_CPU_FLAG_SSSE3 && HAVE_SSSE3) { -+#endif -+#if HAVE_SSSE3 -+ if (mm_flags & AV_CPU_FLAG_SSSE3) { - c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_ssse3; - if (!(mm_flags & AV_CPU_FLAG_ATOM)) { - c->extract_exponents = ff_ac3_extract_exponents_ssse3; - } - } - #endif -+#endif - } -diff --git a/libavcodec/x86/fft.c b/libavcodec/x86/fft.c -index 7918fcb..cf81caa 100644 ---- a/libavcodec/x86/fft.c -+++ b/libavcodec/x86/fft.c -@@ -25,6 +25,7 @@ av_cold void ff_fft_init_mmx(FFTContext *s) - { - #if HAVE_YASM - int has_vectors = av_get_cpu_flags(); -+#if HAVE_AVX - if (has_vectors & AV_CPU_FLAG_AVX && HAVE_AVX && s->nbits >= 5) { - /* AVX for SB */ - s->imdct_calc = ff_imdct_calc_sse; -@@ -32,7 +33,10 @@ av_cold void ff_fft_init_mmx(FFTContext *s) - s->fft_permute = ff_fft_permute_sse; - s->fft_calc = ff_fft_calc_avx; - s->fft_permutation = FF_FFT_PERM_AVX; -- } else if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE) { -+ } else -+#endif -+#if HAVE_SSE -+ if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE) { - /* SSE for P3/P4/K8 */ - s->imdct_calc = ff_imdct_calc_sse; - s->imdct_half = ff_imdct_half_sse; -@@ -41,6 +45,7 @@ av_cold void ff_fft_init_mmx(FFTContext *s) - s->fft_permutation = FF_FFT_PERM_SWAP_LSBS; - } - #endif -+#endif - } - - #if CONFIG_DCT -@@ -48,13 +53,18 @@ av_cold void ff_dct_init_mmx(DCTContext *s) - { - #if HAVE_YASM - int has_vectors = av_get_cpu_flags(); -- if (has_vectors & AV_CPU_FLAG_AVX && HAVE_AVX) -+#if HAVE_AVX -+ if (has_vectors & AV_CPU_FLAG_AVX) - s->dct32 = ff_dct32_float_avx; -- else if (has_vectors & AV_CPU_FLAG_SSE2 && HAVE_SSE) -+ else -+#endif -+#if HAVE_SSE -+ if (has_vectors & AV_CPU_FLAG_SSE2) - s->dct32 = ff_dct32_float_sse2; -- else if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE) -+ else if (has_vectors & AV_CPU_FLAG_SSE) - s->dct32 = ff_dct32_float_sse; - #endif -+#endif - } - #endif - -diff --git a/libavcodec/x86/h264dsp_mmx.c b/libavcodec/x86/h264dsp_mmx.c -index fdf44c5..7bc1c18 100644 ---- a/libavcodec/x86/h264dsp_mmx.c -+++ b/libavcodec/x86/h264dsp_mmx.c -@@ -419,6 +419,7 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, const int chrom - c->biweight_h264_pixels_tab[0]= ff_h264_biweight_16_ssse3; - c->biweight_h264_pixels_tab[1]= ff_h264_biweight_8_ssse3; - } -+#if HAVE_AVX - if (HAVE_AVX && mm_flags&AV_CPU_FLAG_AVX) { - #if HAVE_ALIGNED_STACK - c->h264_v_loop_filter_luma = ff_deblock_v_luma_8_avx; -@@ -427,6 +428,7 @@ void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, const int chrom - c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_avx; - #endif - } -+#endif - } - } - #endif -diff --git a/libavcodec/x86/v210-init.c b/libavcodec/x86/v210-init.c -index 425c628..b881624 100644 ---- a/libavcodec/x86/v210-init.c -+++ b/libavcodec/x86/v210-init.c -@@ -34,15 +34,19 @@ av_cold void v210_x86_init(V210DecContext *s) - if (cpu_flags & AV_CPU_FLAG_SSSE3) - s->unpack_frame = ff_v210_planar_unpack_aligned_ssse3; - -- if (HAVE_AVX && cpu_flags & AV_CPU_FLAG_AVX) -+#if HAVE_AVX -+ if (cpu_flags & AV_CPU_FLAG_AVX) - s->unpack_frame = ff_v210_planar_unpack_aligned_avx; -+#endif - } - else { - if (cpu_flags & AV_CPU_FLAG_SSSE3) - s->unpack_frame = ff_v210_planar_unpack_unaligned_ssse3; - -- if (HAVE_AVX && cpu_flags & AV_CPU_FLAG_AVX) -+#if HAVE_AVX -+ if (cpu_flags & AV_CPU_FLAG_AVX) - s->unpack_frame = ff_v210_planar_unpack_unaligned_avx; -+#endif - } - #endif - } -diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c -index 161c3b4..7dfe988 100644 ---- a/libavdevice/alldevices.c -+++ b/libavdevice/alldevices.c -@@ -38,22 +38,22 @@ void avdevice_register_all(void) - initialized = 1; - - /* devices */ -- REGISTER_INOUTDEV (ALSA, alsa); -+ //REGISTER_INOUTDEV (ALSA, alsa); - REGISTER_INDEV (BKTR, bktr); -- REGISTER_INDEV (DSHOW, dshow); -- REGISTER_INDEV (DV1394, dv1394); -+ //REGISTER_INDEV (DSHOW, dshow); -+ //REGISTER_INDEV (DV1394, dv1394); - REGISTER_INDEV (FBDEV, fbdev); -- REGISTER_INDEV (JACK, jack); -+ //REGISTER_INDEV (JACK, jack); - REGISTER_INDEV (LAVFI, lavfi); - REGISTER_INDEV (OPENAL, openal); - REGISTER_INOUTDEV (OSS, oss); - REGISTER_INDEV (PULSE, pulse); - REGISTER_OUTDEV (SDL, sdl); - REGISTER_INOUTDEV (SNDIO, sndio); -- REGISTER_INDEV (V4L2, v4l2); -- REGISTER_INDEV (V4L, v4l); -- REGISTER_INDEV (VFWCAP, vfwcap); -- REGISTER_INDEV (X11_GRAB_DEVICE, x11_grab_device); -+ //REGISTER_INDEV (V4L2, v4l2); -+ //REGISTER_INDEV (V4L, v4l); -+ //REGISTER_INDEV (VFWCAP, vfwcap); -+ //REGISTER_INDEV (X11_GRAB_DEVICE, x11_grab_device); - - /* external libraries */ - REGISTER_INDEV (LIBCDIO, libcdio); -diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c -index ef99298..e083934 100644 ---- a/libavfilter/allfilters.c -+++ b/libavfilter/allfilters.c -@@ -55,7 +55,7 @@ void avfilter_register_all(void) - REGISTER_FILTER (ABUFFERSINK, abuffersink, asink); - REGISTER_FILTER (ANULLSINK, anullsink, asink); - -- REGISTER_FILTER (ASS, ass, vf); -+ //REGISTER_FILTER (ASS, ass, vf); - REGISTER_FILTER (BLACKFRAME, blackframe, vf); - REGISTER_FILTER (BOXBLUR, boxblur, vf); - REGISTER_FILTER (COPY, copy, vf); -diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c -index 3a96373..d813ecf 100644 ---- a/libavfilter/vf_yadif.c -+++ b/libavfilter/vf_yadif.c -@@ -380,12 +380,20 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) - if (args) sscanf(args, "%d:%d:%d", &yadif->mode, &yadif->parity, &yadif->auto_enable); - - yadif->filter_line = filter_line_c; -+#if HAVE_SSSE3 - if (HAVE_SSSE3 && cpu_flags & AV_CPU_FLAG_SSSE3) - yadif->filter_line = ff_yadif_filter_line_ssse3; -- else if (HAVE_SSE && cpu_flags & AV_CPU_FLAG_SSE2) -+ else -+#endif -+#if HAVE_SSE -+ if (HAVE_SSE && cpu_flags & AV_CPU_FLAG_SSE2) - yadif->filter_line = ff_yadif_filter_line_sse2; -- else if (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX) -+ else -+#endif -+#if HAVE_MMX -+ if (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX) - yadif->filter_line = ff_yadif_filter_line_mmx; -+#endif - - av_log(ctx, AV_LOG_INFO, "mode:%d parity:%d auto_enable:%d\n", yadif->mode, yadif->parity, yadif->auto_enable); - -diff --git a/libavfilter/vsrc_mptestsrc.c b/libavfilter/vsrc_mptestsrc.c -index 96b2a4c..3043204 100644 ---- a/libavfilter/vsrc_mptestsrc.c -+++ b/libavfilter/vsrc_mptestsrc.c -@@ -385,7 +385,6 @@ AVFilter avfilter_vsrc_mptestsrc = { - - .outputs = (const AVFilterPad[]) {{ .name = "default", - .type = AVMEDIA_TYPE_VIDEO, -- .config_props = config_props, - .request_frame = request_frame, - .config_props = config_props, }, - { .name = NULL }}, -diff --git a/libavfilter/x86/yadif_template.c b/libavfilter/x86/yadif_template.c -index 0b60526..cc6f6a8 100644 ---- a/libavfilter/x86/yadif_template.c -+++ b/libavfilter/x86/yadif_template.c -@@ -56,8 +56,8 @@ - #endif - - #define CHECK(pj,mj) \ -- MOVQU" "#pj"(%[cur],%[mrefs]), "MM"2 \n\t" /* cur[x-refs-1+j] */\ -- MOVQU" "#mj"(%[cur],%[prefs]), "MM"3 \n\t" /* cur[x+refs-1-j] */\ -+ MOVQU" "#pj"(%2,%5), "MM"2 \n\t" /* cur[x-refs-1+j] */\ -+ MOVQU" "#mj"(%2,%4), "MM"3 \n\t" /* cur[x+refs-1-j] */\ - MOVQ" "MM"2, "MM"4 \n\t"\ - MOVQ" "MM"2, "MM"5 \n\t"\ - "pxor "MM"3, "MM"4 \n\t"\ -@@ -115,20 +115,20 @@ void RENAME(ff_yadif_filter_line)(uint8_t *dst, - for(x=0; x>1 */\ -- MOVQ" "MM"0, (%[tmpA]) \n\t" /* c */\ -- MOVQ" "MM"3, 16(%[tmpA]) \n\t" /* d */\ -- MOVQ" "MM"1, 32(%[tmpA]) \n\t" /* e */\ -+ MOVQ" "MM"0, (%0) \n\t" /* c */\ -+ MOVQ" "MM"3, 16(%0) \n\t" /* d */\ -+ MOVQ" "MM"1, 32(%0) \n\t" /* e */\ - "psubw "MM"4, "MM"2 \n\t"\ - PABS( MM"4", MM"2") /* temporal_diff0 */\ -- LOAD("(%[prev],%[mrefs])", MM"3") /* prev[x-refs] */\ -- LOAD("(%[prev],%[prefs])", MM"4") /* prev[x+refs] */\ -+ LOAD("(%1,%5)", MM"3") /* prev[x-refs] */\ -+ LOAD("(%1,%4)", MM"4") /* prev[x+refs] */\ - "psubw "MM"0, "MM"3 \n\t"\ - "psubw "MM"1, "MM"4 \n\t"\ - PABS( MM"5", MM"3")\ -@@ -137,8 +137,8 @@ void RENAME(ff_yadif_filter_line)(uint8_t *dst, - "psrlw $1, "MM"2 \n\t"\ - "psrlw $1, "MM"3 \n\t"\ - "pmaxsw "MM"3, "MM"2 \n\t"\ -- LOAD("(%[next],%[mrefs])", MM"3") /* next[x-refs] */\ -- LOAD("(%[next],%[prefs])", MM"4") /* next[x+refs] */\ -+ LOAD("(%3,%5)", MM"3") /* next[x-refs] */\ -+ LOAD("(%3,%4)", MM"4") /* next[x+refs] */\ - "psubw "MM"0, "MM"3 \n\t"\ - "psubw "MM"1, "MM"4 \n\t"\ - PABS( MM"5", MM"3")\ -@@ -146,7 +146,7 @@ void RENAME(ff_yadif_filter_line)(uint8_t *dst, - "paddw "MM"4, "MM"3 \n\t" /* temporal_diff2 */\ - "psrlw $1, "MM"3 \n\t"\ - "pmaxsw "MM"3, "MM"2 \n\t"\ -- MOVQ" "MM"2, 48(%[tmpA]) \n\t" /* diff */\ -+ MOVQ" "MM"2, 48(%0) \n\t" /* diff */\ - \ - "paddw "MM"0, "MM"1 \n\t"\ - "paddw "MM"0, "MM"0 \n\t"\ -@@ -154,8 +154,8 @@ void RENAME(ff_yadif_filter_line)(uint8_t *dst, - "psrlw $1, "MM"1 \n\t" /* spatial_pred */\ - PABS( MM"2", MM"0") /* ABS(c-e) */\ - \ -- MOVQU" -1(%[cur],%[mrefs]), "MM"2 \n\t" /* cur[x-refs-1] */\ -- MOVQU" -1(%[cur],%[prefs]), "MM"3 \n\t" /* cur[x+refs-1] */\ -+ MOVQU" -1(%2,%5), "MM"2 \n\t" /* cur[x-refs-1] */\ -+ MOVQU" -1(%2,%4), "MM"3 \n\t" /* cur[x+refs-1] */\ - MOVQ" "MM"2, "MM"4 \n\t"\ - "psubusb "MM"3, "MM"2 \n\t"\ - "psubusb "MM"4, "MM"3 \n\t"\ -@@ -177,20 +177,20 @@ void RENAME(ff_yadif_filter_line)(uint8_t *dst, - CHECK2\ - \ - /* if(p->mode<2) ... */\ -- MOVQ" 48(%[tmpA]), "MM"6 \n\t" /* diff */\ -- "cmpl $2, %[mode] \n\t"\ -+ MOVQ" 48(%0), "MM"6 \n\t" /* diff */\ -+ "cmpl $2, %6 \n\t"\ - "jge 1f \n\t"\ -- LOAD("(%["prev2"],%[mrefs],2)", MM"2") /* prev2[x-2*refs] */\ -- LOAD("(%["next2"],%[mrefs],2)", MM"4") /* next2[x-2*refs] */\ -- LOAD("(%["prev2"],%[prefs],2)", MM"3") /* prev2[x+2*refs] */\ -- LOAD("(%["next2"],%[prefs],2)", MM"5") /* next2[x+2*refs] */\ -+ LOAD("(%"prev2",%5,2)", MM"2") /* prev2[x-2*refs] */\ -+ LOAD("(%"next2",%5,2)", MM"4") /* next2[x-2*refs] */\ -+ LOAD("(%"prev2",%4,2)", MM"3") /* prev2[x+2*refs] */\ -+ LOAD("(%"next2",%4,2)", MM"5") /* next2[x+2*refs] */\ - "paddw "MM"4, "MM"2 \n\t"\ - "paddw "MM"5, "MM"3 \n\t"\ - "psrlw $1, "MM"2 \n\t" /* b */\ - "psrlw $1, "MM"3 \n\t" /* f */\ -- MOVQ" (%[tmpA]), "MM"4 \n\t" /* c */\ -- MOVQ" 16(%[tmpA]), "MM"5 \n\t" /* d */\ -- MOVQ" 32(%[tmpA]), "MM"7 \n\t" /* e */\ -+ MOVQ" (%0), "MM"4 \n\t" /* c */\ -+ MOVQ" 16(%0), "MM"5 \n\t" /* d */\ -+ MOVQ" 32(%0), "MM"7 \n\t" /* e */\ - "psubw "MM"4, "MM"2 \n\t" /* b-c */\ - "psubw "MM"7, "MM"3 \n\t" /* f-e */\ - MOVQ" "MM"5, "MM"0 \n\t"\ -@@ -209,7 +209,7 @@ void RENAME(ff_yadif_filter_line)(uint8_t *dst, - "pmaxsw "MM"4, "MM"6 \n\t" /* diff= MAX3(diff, min, -max); */\ - "1: \n\t"\ - \ -- MOVQ" 16(%[tmpA]), "MM"2 \n\t" /* d */\ -+ MOVQ" 16(%0), "MM"2 \n\t" /* d */\ - MOVQ" "MM"2, "MM"3 \n\t"\ - "psubw "MM"6, "MM"2 \n\t" /* d-diff */\ - "paddw "MM"6, "MM"3 \n\t" /* d+diff */\ -@@ -218,13 +218,13 @@ void RENAME(ff_yadif_filter_line)(uint8_t *dst, - "packuswb "MM"1, "MM"1 \n\t"\ - \ - :\ -- :[tmpA] "r"(tmpA),\ -- [prev] "r"(prev),\ -- [cur] "r"(cur),\ -- [next] "r"(next),\ -- [prefs]"r"((x86_reg)prefs),\ -- [mrefs]"r"((x86_reg)mrefs),\ -- [mode] "g"(mode)\ -+ : "r"(tmpA),\ -+ "r"(prev),\ -+ "r"(cur),\ -+ "r"(next),\ -+ "r"((x86_reg)prefs),\ -+ "r"((x86_reg)mrefs),\ -+ "g"(mode)\ - );\ - __asm__ volatile(MOV" "MM"1, %0" :"=m"(*dst));\ - dst += STEP;\ -@@ -234,14 +234,14 @@ void RENAME(ff_yadif_filter_line)(uint8_t *dst, - } - - if (parity) { --#define prev2 "prev" --#define next2 "cur" -+#define prev2 "1" -+#define next2 "2" - FILTER - #undef prev2 - #undef next2 - } else { --#define prev2 "cur" --#define next2 "next" -+#define prev2 "2" -+#define next2 "3" - FILTER - #undef prev2 - #undef next2 -diff --git a/libavformat/allformats.c b/libavformat/allformats.c -index 134839f..7b3d63d 100644 ---- a/libavformat/allformats.c -+++ b/libavformat/allformats.c -@@ -48,7 +48,9 @@ void av_register_all(void) - avcodec_register_all(); - - /* (de)muxers */ -+#ifndef __HAIKU__ - REGISTER_MUXER (A64, a64); -+#endif - REGISTER_DEMUXER (AAC, aac); - REGISTER_MUXDEMUX (AC3, ac3); - REGISTER_DEMUXER (ACT, act); -@@ -67,7 +69,9 @@ void av_register_all(void) - REGISTER_MUXER (ASF_STREAM, asf_stream); - REGISTER_MUXDEMUX (AU, au); - REGISTER_MUXDEMUX (AVI, avi); -+#if CONFIG_AVISYNTH_DEMUXER - REGISTER_DEMUXER (AVISYNTH, avisynth); -+#endif - REGISTER_MUXER (AVM2, avm2); - REGISTER_DEMUXER (AVS, avs); - REGISTER_DEMUXER (BETHSOFTVID, bethsoftvid); -diff --git a/libavutil/cpu.c b/libavutil/cpu.c -index fa64a83..c05196f 100644 ---- a/libavutil/cpu.c -+++ b/libavutil/cpu.c -@@ -31,9 +31,13 @@ int av_get_cpu_flags(void) - if (checked) - return flags; - -- if (ARCH_ARM) flags = ff_get_cpu_flags_arm(); -- if (ARCH_PPC) flags = ff_get_cpu_flags_ppc(); -+#if ARCH_ARM -+ flags = ff_get_cpu_flags_arm(); -+#elif ARCH_PPC -+ flags = ff_get_cpu_flags_ppc(); -+#else - if (ARCH_X86) flags = ff_get_cpu_flags_x86(); -+#endif - - checked = 1; - return flags; -diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c -index e73fbfe..3cde56c 100644 ---- a/libavutil/pixdesc.c -+++ b/libavutil/pixdesc.c -@@ -1096,12 +1096,6 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { - .log2_chroma_h = 1, - .flags = PIX_FMT_HWACCEL, - }, -- [PIX_FMT_VDA_VLD] = { -- .name = "vda_vld", -- .log2_chroma_w = 1, -- .log2_chroma_h = 1, -- .flags = PIX_FMT_HWACCEL, -- }, - [PIX_FMT_GRAY8A] = { - .name = "gray8a", - .nb_components = 2, -@@ -1110,16 +1104,6 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { - { 0, 1, 2, 0, 7 }, /* A */ - }, - }, -- [PIX_FMT_GBR24P] = { -- .name = "gbr24p", -- .nb_components= 3, -- .comp = { -- { 1, 0, 1, 0, 7 }, /* B */ -- { 0, 0, 1, 0, 7 }, /* G */ -- { 2, 0, 1, 0, 7 }, /* R */ -- }, -- .flags = PIX_FMT_PLANAR | PIX_FMT_RGB, -- }, - [PIX_FMT_GBRP] = { - .name = "gbrp", - .nb_components = 3, -diff --git a/libswscale/swscale.c b/libswscale/swscale.c -index a98a389..eca61ce 100644 ---- a/libswscale/swscale.c -+++ b/libswscale/swscale.c -@@ -3045,10 +3045,11 @@ SwsFunc ff_getSwsFunc(SwsContext *c) - { - sws_init_swScale_c(c); - -- if (HAVE_MMX) -+#if (HAVE_MMX) - ff_sws_init_swScale_mmx(c); -- if (HAVE_ALTIVEC) -+#elif (HAVE_ALTIVEC) - ff_sws_init_swScale_altivec(c); -+#endif - - return swScale; - } -diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c -index d4b39f4..520fcba 100644 ---- a/libswscale/swscale_unscaled.c -+++ b/libswscale/swscale_unscaled.c -@@ -370,30 +370,38 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t* src[], int srcStr - } - - switch (c->dstFormat) { -- case PIX_FMT_BGR24: -- gbr24ptopacked24((const uint8_t* []) {src[1], src[0], src[2]}, (int []) {srcStride[1], srcStride[0], srcStride[2]}, -+ case PIX_FMT_BGR24: { -+ const uint8_t* src2[] = {src[1], src[0], src[2]}; -+ int srcStride2[] = {srcStride[1], srcStride[0], srcStride[2]}; -+ gbr24ptopacked24(src2, srcStride2, - dst[0] + srcSliceY * dstStride[0], dstStride[0], srcSliceH, c->srcW); - break; -- -- case PIX_FMT_RGB24: -- gbr24ptopacked24((const uint8_t* []) {src[2], src[0], src[1]}, (int []) {srcStride[2], srcStride[0], srcStride[1]}, -+ } -+ case PIX_FMT_RGB24: { -+ const uint8_t* src2[] = {src[2], src[0], src[1]}; -+ int srcStride2[] = {srcStride[2], srcStride[0], srcStride[1]}; -+ gbr24ptopacked24(src2, srcStride2, - dst[0] + srcSliceY * dstStride[0], dstStride[0], srcSliceH, c->srcW); - break; -- -+ } - case PIX_FMT_ARGB: - alpha_first = 1; -- case PIX_FMT_RGBA: -- gbr24ptopacked32((const uint8_t* []) {src[2], src[0], src[1]}, (int []) {srcStride[2], srcStride[0], srcStride[1]}, -+ case PIX_FMT_RGBA: { -+ const uint8_t* src2[] = {src[2], src[0], src[1]}; -+ int srcStride2[] = {srcStride[2], srcStride[0], srcStride[1]}; -+ gbr24ptopacked32(src2, srcStride2, - dst[0] + srcSliceY * dstStride[0], dstStride[0], srcSliceH, alpha_first, c->srcW); - break; -- -+ } - case PIX_FMT_ABGR: - alpha_first = 1; -- case PIX_FMT_BGRA: -- gbr24ptopacked32((const uint8_t* []) {src[1], src[0], src[2]}, (int []) {srcStride[1], srcStride[0], srcStride[2]}, -+ case PIX_FMT_BGRA: { -+ const uint8_t* src2[] = {src[1], src[0], src[2]}; -+ int srcStride2[] = {srcStride[1], srcStride[0], srcStride[2]}; -+ gbr24ptopacked32(src2, srcStride2, - dst[0] + srcSliceY * dstStride[0], dstStride[0], srcSliceH, alpha_first, c->srcW); - break; -- -+ } - default: - av_log(c, AV_LOG_ERROR, "unsupported planar RGB conversion %s -> %s\n", - av_get_pix_fmt_name(c->srcFormat), av_get_pix_fmt_name(c->dstFormat)); -@@ -869,10 +877,11 @@ void ff_get_unscaled_swscale(SwsContext *c) - c->swScale = planarCopyWrapper; - } - -- if (ARCH_BFIN) -+#if (ARCH_BFIN) - ff_bfin_get_unscaled_swscale(c); -- if (HAVE_ALTIVEC) -+#elif (HAVE_ALTIVEC) - ff_swscale_get_unscaled_altivec(c); -+#endif - } - - static void reset_ptr(const uint8_t *src[], int format) -diff --git a/libswscale/utils.c b/libswscale/utils.c -index abd9993..c679ff4 100644 ---- a/libswscale/utils.c -+++ b/libswscale/utils.c -@@ -719,8 +719,10 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], - ff_yuv2rgb_c_init_tables(c, inv_table, srcRange, brightness, contrast, saturation); - //FIXME factorize - -- if (HAVE_ALTIVEC && av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC) -+#if HAVE_ALTIVEC -+ if (av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC) - ff_yuv2rgb_init_tables_altivec(c, inv_table, brightness, contrast, saturation); -+#endif - return 0; - } - -diff --git a/libswscale/x86/swscale_mmx.c b/libswscale/x86/swscale_mmx.c -index fdfd1f2..ded55ac 100644 ---- a/libswscale/x86/swscale_mmx.c -+++ b/libswscale/x86/swscale_mmx.c -@@ -503,7 +503,8 @@ switch(c->dstBpc){ \ - c->yuv2plane1 = ff_yuv2plane1_16_sse4; - } - -- if (HAVE_AVX && cpu_flags & AV_CPU_FLAG_AVX) { -+#if HAVE_AVX -+ if (cpu_flags & AV_CPU_FLAG_AVX) { - ASSIGN_VSCALEX_FUNC(c->yuv2planeX, avx,); - ASSIGN_VSCALE_FUNC(c->yuv2plane1, avx, avx, 1); - -@@ -525,4 +526,5 @@ switch(c->dstBpc){ \ - } - } - #endif -+#endif - } -diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c -index 6100fbc..bb36732 100644 ---- a/libswscale/yuv2rgb.c -+++ b/libswscale/yuv2rgb.c -@@ -507,17 +507,17 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c) - { - SwsFunc t = NULL; - -- if (HAVE_MMX) { -+#if (HAVE_MMX) - t = ff_yuv2rgb_init_mmx(c); -- } else if (HAVE_VIS) { -+#elif (HAVE_VIS) - t = ff_yuv2rgb_init_vis(c); -- } else if (CONFIG_MLIB) { -+#elif (CONFIG_MLIB) - t = ff_yuv2rgb_init_mlib(c); -- } else if (HAVE_ALTIVEC) { -+#elif (HAVE_ALTIVEC) - t = ff_yuv2rgb_init_altivec(c); -- } else if (ARCH_BFIN) { -+#elif (ARCH_BFIN) - t = ff_yuv2rgb_get_func_ptr_bfin(c); -- } -+#endif - - if (t) - return t; --- -2.2.2 - - -From 39b3287907dcad7e801898e544b3332e198a7d20 Mon Sep 17 00:00:00 2001 -From: Adrien Destugues -Date: Sun, 30 Aug 2015 13:58:56 +0200 -Subject: ffmpeg_legacy: fix more gcc2 undefined reference problems in 0.10.14. - - -diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c -index 970c5ed..8c55fb3 100644 ---- a/libavcodec/allcodecs.c -+++ b/libavcodec/allcodecs.c -@@ -155,7 +155,9 @@ void avcodec_register_all(void) - REGISTER_DECODER (MJPEGB, mjpegb); - REGISTER_DECODER (MMVIDEO, mmvideo); - REGISTER_DECODER (MOTIONPIXELS, motionpixels); -+#if __GNUC__ > 2 - REGISTER_DECODER (MPEG_XVMC, mpeg_xvmc); -+#endif - REGISTER_ENCDEC (MPEG1VIDEO, mpeg1video); - REGISTER_ENCDEC (MPEG2VIDEO, mpeg2video); - REGISTER_ENCDEC (MPEG4, mpeg4); -diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c -index 8e0568e..4231719 100644 ---- a/libavcodec/mpeg12.c -+++ b/libavcodec/mpeg12.c -@@ -2338,8 +2338,10 @@ static int decode_chunks(AVCodecContext *avctx, - s2->error_count += s2->thread_context[i]->error_count; - } - -- if (CONFIG_VDPAU && uses_vdpau(avctx)) -+#if CONFIG_VDPAU -+ if (uses_vdpau(avctx)) - ff_vdpau_mpeg_picture_complete(s2, buf, buf_size, s->slice_count); -+#endif - - - if (slice_end(avctx, picture)) { -diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c -index 0bedbeb..c1757c0 100644 ---- a/libavcodec/mpegvideo.c -+++ b/libavcodec/mpegvideo.c -@@ -1346,7 +1346,7 @@ void MPV_frame_end(MpegEncContext *s) - /* redraw edges for the frame if decoding didn't complete */ - // just to make sure that all data is rendered. - #if CONFIG_MPEG_XVMC_DECODER -- if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) { -+ if (s->avctx->xvmc_acceleration) { - ff_xvmc_field_end(s); - } else - #endif -@@ -2279,10 +2279,12 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], - int lowres_flag, int is_mpeg12) - { - const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; -- if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration){ -+#if CONFIG_MPEG_XVMC_DECODER -+ if(s->avctx->xvmc_acceleration) { - ff_xvmc_decode_mb(s);//xvmc uses pblocks - return; - } -+#endif - - if(s->avctx->debug&FF_DEBUG_DCT_COEFF) { - /* save DCT coefficients */ -diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c -index 7dfe988..a35efa0 100644 ---- a/libavdevice/alldevices.c -+++ b/libavdevice/alldevices.c -@@ -38,22 +38,28 @@ void avdevice_register_all(void) - initialized = 1; - - /* devices */ -- //REGISTER_INOUTDEV (ALSA, alsa); -+#ifndef __HAIKU__ -+ REGISTER_INOUTDEV (ALSA, alsa); - REGISTER_INDEV (BKTR, bktr); -- //REGISTER_INDEV (DSHOW, dshow); -- //REGISTER_INDEV (DV1394, dv1394); -+ REGISTER_INDEV (DSHOW, dshow); -+ REGISTER_INDEV (DV1394, dv1394); -+#endif - REGISTER_INDEV (FBDEV, fbdev); -- //REGISTER_INDEV (JACK, jack); -+#ifndef __HAIKU__ -+ REGISTER_INDEV (JACK, jack); -+#endif - REGISTER_INDEV (LAVFI, lavfi); - REGISTER_INDEV (OPENAL, openal); - REGISTER_INOUTDEV (OSS, oss); - REGISTER_INDEV (PULSE, pulse); - REGISTER_OUTDEV (SDL, sdl); - REGISTER_INOUTDEV (SNDIO, sndio); -- //REGISTER_INDEV (V4L2, v4l2); -- //REGISTER_INDEV (V4L, v4l); -- //REGISTER_INDEV (VFWCAP, vfwcap); -- //REGISTER_INDEV (X11_GRAB_DEVICE, x11_grab_device); -+#ifndef __HAIKU__ -+ REGISTER_INDEV (V4L2, v4l2); -+ REGISTER_INDEV (V4L, v4l); -+ REGISTER_INDEV (VFWCAP, vfwcap); -+ REGISTER_INDEV (X11_GRAB_DEVICE, x11_grab_device); -+#endif - - /* external libraries */ - REGISTER_INDEV (LIBCDIO, libcdio); -diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c -index e083934..778c7b2 100644 ---- a/libavfilter/allfilters.c -+++ b/libavfilter/allfilters.c -@@ -64,7 +64,9 @@ void avfilter_register_all(void) - REGISTER_FILTER (DELOGO, delogo, vf); - REGISTER_FILTER (DESHAKE, deshake, vf); - REGISTER_FILTER (DRAWBOX, drawbox, vf); -+#if __GNUC__ > 2 - REGISTER_FILTER (DRAWTEXT, drawtext, vf); -+#endif - REGISTER_FILTER (FADE, fade, vf); - REGISTER_FILTER (FIELDORDER, fieldorder, vf); - REGISTER_FILTER (FIFO, fifo, vf); -diff --git a/libavformat/allformats.c b/libavformat/allformats.c -index 7b3d63d..2975bd8 100644 ---- a/libavformat/allformats.c -+++ b/libavformat/allformats.c -@@ -255,10 +255,10 @@ void av_register_all(void) - REGISTER_MUXDEMUX (YUV4MPEGPIPE, yuv4mpegpipe); - - /* external libraries */ --#if CONFIG_LIBMODPLUG - REGISTER_DEMUXER (LIBMODPLUG, libmodplug); --#endif -+#if __GNUC__ > 2 - REGISTER_MUXDEMUX (LIBNUT, libnut); -+#endif - - /* protocols */ - REGISTER_PROTOCOL (APPLEHTTP, applehttp); --- -2.2.2 - diff --git a/media-video/ffmpeg/patches/ffmpeg-0.10.16.patchset b/media-video/ffmpeg/patches/ffmpeg-0.10.16.patchset index bb2ef3ea18..2b88970ac7 100644 --- a/media-video/ffmpeg/patches/ffmpeg-0.10.16.patchset +++ b/media-video/ffmpeg/patches/ffmpeg-0.10.16.patchset @@ -1,4 +1,4 @@ -From 93bf7e38f5566a5a262729d81938c762c4bef60c Mon Sep 17 00:00:00 2001 +From 43d544a54296b713901bfc8a262ef1d73c9ea3a1 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 30 Aug 2015 13:15:31 +0200 Subject: applying patch ffmpeg-0.10.14-gcc2.patch @@ -1461,20 +1461,38 @@ index 6100fbc..bb36732 100644 if (t) return t; -- -2.2.2 +2.7.0 -From 18ee4b14c3a024184d6146a72ecd6408c1af4141 Mon Sep 17 00:00:00 2001 +From f007c9b15d9adb8371eb956661c75dbe534a4c1d Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 30 Aug 2015 13:58:56 +0200 -Subject: ffmpeg_legacy: fix more gcc2 undefined reference problems in 0.10.14. +Subject: Fix "undefined reference"s when building with gcc2. +Through macros, ffmpeg uses this pattern a lot: + + #define something 0 + if (something) optional_function(); + +Unfortunately, gcc2 does not fully optimize away the code, and there is +still a reference to optional_function() in the final binary (but no +implementation). Manually add #ifdef at the relevant places to get +things working. diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c -index 970c5ed..8c55fb3 100644 +index 970c5ed..5dc9e78 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c -@@ -155,7 +155,9 @@ void avcodec_register_all(void) +@@ -128,7 +128,7 @@ void avcodec_register_all(void) + REGISTER_DECODER (H263I, h263i); + REGISTER_ENCODER (H263P, h263p); + REGISTER_DECODER (H264, h264); +-#ifndef __HAIKU__ ++#if __GNUC__ > 2 + REGISTER_DECODER (H264_CRYSTALHD, h264_crystalhd); + REGISTER_DECODER (H264_VDPAU, h264_vdpau); + #endif +@@ -155,17 +155,23 @@ void avcodec_register_all(void) REGISTER_DECODER (MJPEGB, mjpegb); REGISTER_DECODER (MMVIDEO, mmvideo); REGISTER_DECODER (MOTIONPIXELS, motionpixels); @@ -1484,6 +1502,74 @@ index 970c5ed..8c55fb3 100644 REGISTER_ENCDEC (MPEG1VIDEO, mpeg1video); REGISTER_ENCDEC (MPEG2VIDEO, mpeg2video); REGISTER_ENCDEC (MPEG4, mpeg4); ++#if __GNUC__ > 2 + REGISTER_DECODER (MPEG4_CRYSTALHD, mpeg4_crystalhd); + REGISTER_DECODER (MPEG4_VDPAU, mpeg4_vdpau); ++#endif + REGISTER_DECODER (MPEGVIDEO, mpegvideo); ++#if __GNUC__ > 2 + REGISTER_DECODER (MPEG_VDPAU, mpeg_vdpau); + REGISTER_DECODER (MPEG1_VDPAU, mpeg1_vdpau); + REGISTER_DECODER (MPEG2_CRYSTALHD, mpeg2_crystalhd); + REGISTER_DECODER (MSMPEG4_CRYSTALHD, msmpeg4_crystalhd); ++#endif + REGISTER_DECODER (MSMPEG4V1, msmpeg4v1); + REGISTER_ENCDEC (MSMPEG4V2, msmpeg4v2); + REGISTER_ENCDEC (MSMPEG4V3, msmpeg4v3); +@@ -226,8 +232,10 @@ void avcodec_register_all(void) + REGISTER_DECODER (VB, vb); + REGISTER_DECODER (VBLE, vble); + REGISTER_DECODER (VC1, vc1); ++#if __GNUC__ > 2 + REGISTER_DECODER (VC1_CRYSTALHD, vc1_crystalhd); + REGISTER_DECODER (VC1_VDPAU, vc1_vdpau); ++#endif + REGISTER_DECODER (VC1IMAGE, vc1image); + REGISTER_DECODER (VCR1, vcr1); + REGISTER_DECODER (VMDVIDEO, vmdvideo); +@@ -242,8 +250,10 @@ void avcodec_register_all(void) + REGISTER_ENCDEC (WMV1, wmv1); + REGISTER_ENCDEC (WMV2, wmv2); + REGISTER_DECODER (WMV3, wmv3); ++#if __GNUC__ > 2 + REGISTER_DECODER (WMV3_CRYSTALHD, wmv3_crystalhd); + REGISTER_DECODER (WMV3_VDPAU, wmv3_vdpau); ++#endif + REGISTER_DECODER (WMV3IMAGE, wmv3image); + REGISTER_DECODER (WNV1, wnv1); + REGISTER_DECODER (XAN_WC3, xan_wc3); +@@ -397,6 +407,7 @@ void avcodec_register_all(void) + REGISTER_ENCDEC (XSUB, xsub); + + /* external libraries */ ++#if __GNUC__ > 2 + REGISTER_ENCODER (LIBAACPLUS, libaacplus); + REGISTER_DECODER (LIBCELT, libcelt); + REGISTER_ENCDEC (LIBDIRAC, libdirac); +@@ -408,18 +419,19 @@ void avcodec_register_all(void) + REGISTER_DECODER (LIBOPENCORE_AMRWB, libopencore_amrwb); + REGISTER_ENCDEC (LIBOPENJPEG, libopenjpeg); + REGISTER_ENCDEC (LIBSCHROEDINGER, libschroedinger); +- REGISTER_ENCDEC (LIBSPEEX, libspeex); + REGISTER_DECODER (LIBSTAGEFRIGHT_H264, libstagefright_h264); +- REGISTER_ENCODER (LIBTHEORA, libtheora); + REGISTER_DECODER (LIBUTVIDEO, libutvideo); + REGISTER_ENCODER (LIBVO_AACENC, libvo_aacenc); + REGISTER_ENCODER (LIBVO_AMRWBENC, libvo_amrwbenc); +- REGISTER_ENCODER (LIBVORBIS, libvorbis); +- REGISTER_ENCDEC (LIBVPX, libvpx); + REGISTER_ENCODER (LIBX264, libx264); + REGISTER_ENCODER (LIBX264RGB, libx264rgb); + REGISTER_ENCODER (LIBXAVS, libxavs); + REGISTER_ENCODER (LIBXVID, libxvid); ++#endif ++ REGISTER_ENCDEC (LIBSPEEX, libspeex); ++ REGISTER_ENCODER (LIBTHEORA, libtheora); ++ REGISTER_ENCODER (LIBVORBIS, libvorbis); ++ REGISTER_ENCDEC (LIBVPX, libvpx); + + /* text */ + REGISTER_DECODER (BINTEXT, bintext); diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 8e0568e..4231719 100644 --- a/libavcodec/mpeg12.c @@ -1528,10 +1614,10 @@ index f82406a..fcd7a7a 100644 if(s->avctx->debug&FF_DEBUG_DCT_COEFF) { /* save DCT coefficients */ diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c -index 7dfe988..a35efa0 100644 +index 7dfe988..383ca38 100644 --- a/libavdevice/alldevices.c +++ b/libavdevice/alldevices.c -@@ -38,22 +38,28 @@ void avdevice_register_all(void) +@@ -38,24 +38,30 @@ void avdevice_register_all(void) initialized = 1; /* devices */ @@ -1543,13 +1629,12 @@ index 7dfe988..a35efa0 100644 - //REGISTER_INDEV (DV1394, dv1394); + REGISTER_INDEV (DSHOW, dshow); + REGISTER_INDEV (DV1394, dv1394); -+#endif REGISTER_INDEV (FBDEV, fbdev); - //REGISTER_INDEV (JACK, jack); -+#ifndef __HAIKU__ + REGISTER_INDEV (JACK, jack); +#endif REGISTER_INDEV (LAVFI, lavfi); ++#ifndef __HAIKU__ REGISTER_INDEV (OPENAL, openal); REGISTER_INOUTDEV (OSS, oss); REGISTER_INDEV (PULSE, pulse); @@ -1559,7 +1644,6 @@ index 7dfe988..a35efa0 100644 - //REGISTER_INDEV (V4L, v4l); - //REGISTER_INDEV (VFWCAP, vfwcap); - //REGISTER_INDEV (X11_GRAB_DEVICE, x11_grab_device); -+#ifndef __HAIKU__ + REGISTER_INDEV (V4L2, v4l2); + REGISTER_INDEV (V4L, v4l); + REGISTER_INDEV (VFWCAP, vfwcap); @@ -1567,12 +1651,16 @@ index 7dfe988..a35efa0 100644 +#endif /* external libraries */ ++#ifndef __HAIKU__ REGISTER_INDEV (LIBCDIO, libcdio); + REGISTER_INDEV (LIBDC1394, libdc1394); ++#endif + } diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c -index e083934..778c7b2 100644 +index e083934..66f4204 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c -@@ -64,7 +64,9 @@ void avfilter_register_all(void) +@@ -64,12 +64,16 @@ void avfilter_register_all(void) REGISTER_FILTER (DELOGO, delogo, vf); REGISTER_FILTER (DESHAKE, deshake, vf); REGISTER_FILTER (DRAWBOX, drawbox, vf); @@ -1582,8 +1670,35 @@ index e083934..778c7b2 100644 REGISTER_FILTER (FADE, fade, vf); REGISTER_FILTER (FIELDORDER, fieldorder, vf); REGISTER_FILTER (FIFO, fifo, vf); + REGISTER_FILTER (FORMAT, format, vf); ++#if __GNUC__ > 2 + REGISTER_FILTER (FREI0R, frei0r, vf); ++#endif + REGISTER_FILTER (GRADFUN, gradfun, vf); + REGISTER_FILTER (HFLIP, hflip, vf); + REGISTER_FILTER (HQDN3D, hqdn3d, vf); +@@ -80,7 +84,9 @@ void avfilter_register_all(void) + REGISTER_FILTER (NEGATE, negate, vf); + REGISTER_FILTER (NOFORMAT, noformat, vf); + REGISTER_FILTER (NULL, null, vf); ++#if __GNUC__ > 2 + REGISTER_FILTER (OCV, ocv, vf); ++#endif + REGISTER_FILTER (OVERLAY, overlay, vf); + REGISTER_FILTER (PAD, pad, vf); + REGISTER_FILTER (PIXDESCTEST, pixdesctest, vf); +@@ -103,7 +109,9 @@ void avfilter_register_all(void) + + REGISTER_FILTER (CELLAUTO, cellauto, vsrc); + REGISTER_FILTER (COLOR, color, vsrc); ++#if __GNUC__ > 2 + REGISTER_FILTER (FREI0R, frei0r_src, vsrc); ++#endif + REGISTER_FILTER (LIFE, life, vsrc); + REGISTER_FILTER (MANDELBROT, mandelbrot, vsrc); + REGISTER_FILTER (MOVIE, movie, vsrc); diff --git a/libavformat/allformats.c b/libavformat/allformats.c -index 7b3d63d..2975bd8 100644 +index 7b3d63d..1eaa391 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -255,10 +255,10 @@ void av_register_all(void) @@ -1599,80 +1714,25 @@ index 7b3d63d..2975bd8 100644 /* protocols */ REGISTER_PROTOCOL (APPLEHTTP, applehttp); --- -2.2.2 - - -From 406d5f8c1a2aa28fc96a2cc857af45844bb03732 Mon Sep 17 00:00:00 2001 -From: Adrien Destugues -Date: Sun, 27 Dec 2015 19:48:47 +0100 -Subject: filter out some more codecs for gcc2. - - -diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c -index 8c55fb3..589cd1d 100644 ---- a/libavcodec/allcodecs.c -+++ b/libavcodec/allcodecs.c -@@ -128,7 +128,7 @@ void avcodec_register_all(void) - REGISTER_DECODER (H263I, h263i); - REGISTER_ENCODER (H263P, h263p); - REGISTER_DECODER (H264, h264); --#ifndef __HAIKU__ -+#if __GNUC__ > 2 - REGISTER_DECODER (H264_CRYSTALHD, h264_crystalhd); - REGISTER_DECODER (H264_VDPAU, h264_vdpau); - #endif -@@ -161,13 +161,17 @@ void avcodec_register_all(void) - REGISTER_ENCDEC (MPEG1VIDEO, mpeg1video); - REGISTER_ENCDEC (MPEG2VIDEO, mpeg2video); - REGISTER_ENCDEC (MPEG4, mpeg4); -+#if __GNUC__ > 2 - REGISTER_DECODER (MPEG4_CRYSTALHD, mpeg4_crystalhd); - REGISTER_DECODER (MPEG4_VDPAU, mpeg4_vdpau); -+#endif - REGISTER_DECODER (MPEGVIDEO, mpegvideo); -+#if __GNUC__ > 2 - REGISTER_DECODER (MPEG_VDPAU, mpeg_vdpau); - REGISTER_DECODER (MPEG1_VDPAU, mpeg1_vdpau); - REGISTER_DECODER (MPEG2_CRYSTALHD, mpeg2_crystalhd); - REGISTER_DECODER (MSMPEG4_CRYSTALHD, msmpeg4_crystalhd); -+#endif - REGISTER_DECODER (MSMPEG4V1, msmpeg4v1); - REGISTER_ENCDEC (MSMPEG4V2, msmpeg4v2); - REGISTER_ENCDEC (MSMPEG4V3, msmpeg4v3); -@@ -228,8 +232,10 @@ void avcodec_register_all(void) - REGISTER_DECODER (VB, vb); - REGISTER_DECODER (VBLE, vble); - REGISTER_DECODER (VC1, vc1); +@@ -269,7 +269,9 @@ void av_register_all(void) + REGISTER_PROTOCOL (GOPHER, gopher); + REGISTER_PROTOCOL (HTTP, http); + REGISTER_PROTOCOL (HTTPPROXY, httpproxy); +#if __GNUC__ > 2 - REGISTER_DECODER (VC1_CRYSTALHD, vc1_crystalhd); - REGISTER_DECODER (VC1_VDPAU, vc1_vdpau); + REGISTER_PROTOCOL (HTTPS, https); +#endif - REGISTER_DECODER (VC1IMAGE, vc1image); - REGISTER_DECODER (VCR1, vcr1); - REGISTER_DECODER (VMDVIDEO, vmdvideo); -@@ -244,8 +250,10 @@ void avcodec_register_all(void) - REGISTER_ENCDEC (WMV1, wmv1); - REGISTER_ENCDEC (WMV2, wmv2); - REGISTER_DECODER (WMV3, wmv3); -+#if __GNUC__ > 2 - REGISTER_DECODER (WMV3_CRYSTALHD, wmv3_crystalhd); - REGISTER_DECODER (WMV3_VDPAU, wmv3_vdpau); -+#endif - REGISTER_DECODER (WMV3IMAGE, wmv3image); - REGISTER_DECODER (WNV1, wnv1); - REGISTER_DECODER (XAN_WC3, xan_wc3); -@@ -399,8 +407,10 @@ void avcodec_register_all(void) - REGISTER_ENCDEC (XSUB, xsub); - - /* external libraries */ + REGISTER_PROTOCOL (MMSH, mmsh); + REGISTER_PROTOCOL (MMST, mmst); + REGISTER_PROTOCOL (MD5, md5); +@@ -283,6 +285,8 @@ void av_register_all(void) + #endif + REGISTER_PROTOCOL (RTP, rtp); + REGISTER_PROTOCOL (TCP, tcp); +#if __GNUC__ > 2 - REGISTER_ENCODER (LIBAACPLUS, libaacplus); - REGISTER_DECODER (LIBCELT, libcelt); + REGISTER_PROTOCOL (TLS, tls); +#endif - REGISTER_ENCDEC (LIBDIRAC, libdirac); - REGISTER_ENCODER (LIBFAAC, libfaac); - REGISTER_ENCDEC (LIBGSM, libgsm); + REGISTER_PROTOCOL (UDP, udp); + } -- -2.2.2 +2.7.0 diff --git a/media-video/ffmpeg/patches/ffmpeg-0.11.5.patchset b/media-video/ffmpeg/patches/ffmpeg-0.11.5.patchset deleted file mode 100644 index 05adc2f734..0000000000 --- a/media-video/ffmpeg/patches/ffmpeg-0.11.5.patchset +++ /dev/null @@ -1,1043 +0,0 @@ -From 6f35c0d178448ffa3b8fc22c9b88694c52f4e132 Mon Sep 17 00:00:00 2001 -From: Adrien Destugues -Date: Fri, 24 Oct 2014 09:41:41 +0000 -Subject: applying patch ffmpeg-0.11.5-gcc4.patch - - -diff --git a/doc/filters.texi b/doc/filters.texi -index 324a154..7303a7d 100644 ---- a/doc/filters.texi -+++ b/doc/filters.texi -@@ -2924,7 +2924,7 @@ Tile several successive frames together. - It accepts as argument the tile size (i.e. the number of lines and columns) - in the form "@var{w}x@var{h}". - --For example, produce 8×8 PNG tiles of all keyframes (@option{-skip_frame -+For example, produce 8x8 PNG tiles of all keyframes (@option{-skip_frame - nokey}) in a movie: - @example - ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png --- -2.2.2 - - -From 048247798d420c5c081dfa87c36c1c3099b122c5 Mon Sep 17 00:00:00 2001 -From: Adrien Destugues -Date: Sun, 30 Aug 2015 10:59:56 +0200 -Subject: Fix build with gcc2 and --disable-asm. - -* Confirmed that this fixes the problems with playing h264 and other -formats. Not sure if the update to 0.11.5 is worth it, since apparently -the 0.10.x series is getting more updates from ffmpeg team. - -diff --git a/cmdutils.c b/cmdutils.c -index 9afb54c..e331af1 100644 ---- a/cmdutils.c -+++ b/cmdutils.c -@@ -20,6 +20,7 @@ - */ - - #include -+#include - #include - #include - #include -@@ -55,6 +56,8 @@ - #include - #endif - -+#define va_copy(a,b) ((a)=(b)) -+ - struct SwsContext *sws_opts; - SwrContext *swr_opts; - AVDictionary *format_opts, *codec_opts; -diff --git a/ffprobe.c b/ffprobe.c -index d53ec11..d91eda7 100644 ---- a/ffprobe.c -+++ b/ffprobe.c -@@ -312,7 +312,7 @@ static void writer_print_time(WriterContext *wctx, const char *key, - writer_print_string(wctx, key, "N/A", 1); - } else { - double d = ts * av_q2d(*time_base); -- value_string(buf, sizeof(buf), (struct unit_value){.val.d=d, .unit=unit_second_str}); -+ value_string(buf, sizeof(buf), (struct unit_value){d, unit_second_str}); - writer_print_string(wctx, key, buf, 0); - } - } -@@ -1188,7 +1188,7 @@ static void writer_register_all(void) - #define print_time(k, v, tb) writer_print_time(w, k, v, tb) - #define print_ts(k, v) writer_print_ts(w, k, v) - #define print_val(k, v, u) writer_print_string(w, k, \ -- value_string(val_str, sizeof(val_str), (struct unit_value){.val.i = v, .unit=u}), 0) -+ value_string(val_str, sizeof(val_str), (struct unit_value){v, u}), 0) - #define print_section_header(s) writer_print_section_header(w, s) - #define print_section_footer(s) writer_print_section_footer(w, s) - #define show_tags(metadata) writer_show_tags(w, metadata) -@@ -1658,7 +1658,9 @@ static void ffprobe_show_library_versions(WriterContext *w) - SHOW_LIB_VERSION(avfilter, AVFILTER); - SHOW_LIB_VERSION(swscale, SWSCALE); - SHOW_LIB_VERSION(swresample, SWRESAMPLE); -+#if 0 - SHOW_LIB_VERSION(postproc, POSTPROC); -+#endif - writer_print_chapter_footer(w, "library_versions"); - } - -diff --git a/libavcodec/aacpsdsp.c b/libavcodec/aacpsdsp.c -index e90c50b..84c4a49 100644 ---- a/libavcodec/aacpsdsp.c -+++ b/libavcodec/aacpsdsp.c -@@ -209,6 +209,7 @@ av_cold void ff_psdsp_init(PSDSPContext *s) - s->stereo_interpolate[0] = ps_stereo_interpolate_c; - s->stereo_interpolate[1] = ps_stereo_interpolate_ipdopd_c; - -- if (ARCH_ARM) -+#if ARCH_ARM - ff_psdsp_init_arm(s); -+#endif - } -diff --git a/libavcodec/ac3dsp.c b/libavcodec/ac3dsp.c -index 581e5f5..cf7dedc 100644 ---- a/libavcodec/ac3dsp.c -+++ b/libavcodec/ac3dsp.c -@@ -228,8 +228,10 @@ av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact) - c->sum_square_butterfly_int32 = ac3_sum_square_butterfly_int32_c; - c->sum_square_butterfly_float = ac3_sum_square_butterfly_float_c; - -- if (ARCH_ARM) -+#if ARCH_ARM - ff_ac3dsp_init_arm(c, bit_exact); -- if (HAVE_MMX) -+#endif -+#if HAVE_MMX - ff_ac3dsp_init_x86(c, bit_exact); -+#endif - } -diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c -index ac05b9b..8ca524a 100644 ---- a/libavcodec/allcodecs.c -+++ b/libavcodec/allcodecs.c -@@ -54,6 +54,7 @@ void avcodec_register_all(void) - initialized = 1; - - /* hardware accelerators */ -+#if __GNUC__ > 2 - REGISTER_HWACCEL (H263_VAAPI, h263_vaapi); - REGISTER_HWACCEL (H264_DXVA2, h264_dxva2); - REGISTER_HWACCEL (H264_VAAPI, h264_vaapi); -@@ -67,6 +68,7 @@ void avcodec_register_all(void) - REGISTER_HWACCEL (VC1_VAAPI, vc1_vaapi); - REGISTER_HWACCEL (WMV3_DXVA2, wmv3_dxva2); - REGISTER_HWACCEL (WMV3_VAAPI, wmv3_vaapi); -+#endif - - /* video codecs */ - REGISTER_ENCODER (A64MULTI, a64multi); -diff --git a/libavcodec/cavsdsp.c b/libavcodec/cavsdsp.c -index 192e0f9..42fa63c 100644 ---- a/libavcodec/cavsdsp.c -+++ b/libavcodec/cavsdsp.c -@@ -544,5 +544,7 @@ av_cold void ff_cavsdsp_init(CAVSDSPContext* c, AVCodecContext *avctx) { - c->cavs_filter_ch = cavs_filter_ch_c; - c->cavs_idct8_add = cavs_idct8_add_c; - -- if (HAVE_MMX) ff_cavsdsp_init_mmx(c, avctx); -+#if HAVE_MMX -+ ff_cavsdsp_init_mmx(c, avctx); -+#endif - } -diff --git a/libavcodec/dcadsp.c b/libavcodec/dcadsp.c -index dd4994d..7a980a1 100644 ---- a/libavcodec/dcadsp.c -+++ b/libavcodec/dcadsp.c -@@ -47,5 +47,7 @@ static void dca_lfe_fir_c(float *out, const float *in, const float *coefs, - void ff_dcadsp_init(DCADSPContext *s) - { - s->lfe_fir = dca_lfe_fir_c; -- if (ARCH_ARM) ff_dcadsp_init_arm(s); -+#if ARCH_ARM -+ ff_dcadsp_init_arm(s); -+#endif - } -diff --git a/libavcodec/dct.c b/libavcodec/dct.c -index 4800e13..aff6a81 100644 ---- a/libavcodec/dct.c -+++ b/libavcodec/dct.c -@@ -208,8 +208,9 @@ av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse) - } - - s->dct32 = ff_dct32_float; -- if (HAVE_MMX) -+#if HAVE_MMX - ff_dct_init_mmx(s); -+#endif - - return 0; - } -diff --git a/libavcodec/diracdsp.c b/libavcodec/diracdsp.c -index 429241d..57990b1 100644 ---- a/libavcodec/diracdsp.c -+++ b/libavcodec/diracdsp.c -@@ -197,5 +197,7 @@ void ff_diracdsp_init(DiracDSPContext *c) - PIXFUNC(avg, 16); - PIXFUNC(avg, 32); - -- if (HAVE_MMX && HAVE_YASM) ff_diracdsp_init_mmx(c); -+#if HAVE_MMX && HAVE_YASM -+ ff_diracdsp_init_mmx(c); -+#endif - } -diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c -index a13540d..96a955a 100644 ---- a/libavcodec/dsputil.c -+++ b/libavcodec/dsputil.c -@@ -3169,14 +3169,30 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx) - } - - -- if (HAVE_MMX) ff_dsputil_init_mmx (c, avctx); -- if (ARCH_ARM) ff_dsputil_init_arm (c, avctx); -- if (HAVE_VIS) ff_dsputil_init_vis (c, avctx); -- if (ARCH_ALPHA) ff_dsputil_init_alpha (c, avctx); -- if (ARCH_PPC) ff_dsputil_init_ppc (c, avctx); -- if (HAVE_MMI) ff_dsputil_init_mmi (c, avctx); -- if (ARCH_SH4) ff_dsputil_init_sh4 (c, avctx); -- if (ARCH_BFIN) ff_dsputil_init_bfin (c, avctx); -+#if HAVE_MMX -+ ff_dsputil_init_mmx (c, avctx); -+#endif -+#if ARCH_ARM -+ ff_dsputil_init_arm (c, avctx); -+#endif -+#if HAVE_VIS -+ ff_dsputil_init_vis (c, avctx); -+#endif -+#if ARCH_ALPHA -+ ff_dsputil_init_alpha (c, avctx); -+#endif -+#if ARCH_PPC -+ ff_dsputil_init_ppc (c, avctx); -+#endif -+#if HAVE_MMI -+ ff_dsputil_init_mmi (c, avctx); -+#endif -+#if ARCH_SH4 -+ ff_dsputil_init_sh4 (c, avctx); -+#endif -+#if ARCH_BFIN -+ ff_dsputil_init_bfin (c, avctx); -+#endif - - for (i = 0; i < 4; i++) { - for (j = 0; j < 16; j++) { -diff --git a/libavcodec/dwt.c b/libavcodec/dwt.c -index 6c1f131..e87b19a 100644 ---- a/libavcodec/dwt.c -+++ b/libavcodec/dwt.c -@@ -993,8 +993,9 @@ void ff_dwt_init(DWTContext *c) - c->horizontal_compose97i = ff_snow_horizontal_compose97i; - c->inner_add_yblock = ff_snow_inner_add_yblock; - -- if (HAVE_MMX) -+#if HAVE_MMX - ff_dwt_init_x86(c); -+#endif - } - - -diff --git a/libavcodec/fft.c b/libavcodec/fft.c -index 6b93a5c..916145e 100644 ---- a/libavcodec/fft.c -+++ b/libavcodec/fft.c -@@ -164,7 +164,9 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse) - if (CONFIG_MDCT) s->mdct_calcw = s->mdct_calc; - #else - if (CONFIG_MDCT) s->mdct_calcw = ff_mdct_calcw_c; -- if (ARCH_ARM) ff_fft_fixed_init_arm(s); -+#if ARCH_ARM -+ ff_fft_fixed_init_arm(s); -+#endif - #endif - - for(j=4; j<=nbits; j++) { -diff --git a/libavcodec/fmtconvert.c b/libavcodec/fmtconvert.c -index c03117c..40c0e33 100644 ---- a/libavcodec/fmtconvert.c -+++ b/libavcodec/fmtconvert.c -@@ -82,9 +82,15 @@ av_cold void ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx) - c->float_to_int16_interleave = float_to_int16_interleave_c; - c->float_interleave = ff_float_interleave_c; - -- if (ARCH_ARM) ff_fmt_convert_init_arm(c, avctx); -- if (HAVE_ALTIVEC) ff_fmt_convert_init_altivec(c, avctx); -- if (HAVE_MMX) ff_fmt_convert_init_x86(c, avctx); -+#if (ARCH_ARM) -+ ff_fmt_convert_init_arm(c, avctx); -+#endif -+#if (HAVE_ALTIVEC) -+ ff_fmt_convert_init_altivec(c, avctx); -+#endif -+#if (HAVE_MMX) -+ ff_fmt_convert_init_x86(c, avctx); -+#endif - } - - /* ffdshow custom code */ -diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c -index 4d3c7b8..c3873f9 100644 ---- a/libavcodec/h263dec.c -+++ b/libavcodec/h263dec.c -@@ -648,10 +648,12 @@ retry: - - if (!s->divx_packed) ff_thread_finish_setup(avctx); - -- if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)) { -+#if CONFIG_MPEG4_VDPAU_DECODER -+ if ((s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)) { - ff_vdpau_mpeg4_decode_picture(s, s->gb.buffer, s->gb.buffer_end - s->gb.buffer); - goto frame_end; - } -+#endif - - if (avctx->hwaccel) { - if (avctx->hwaccel->start_frame(avctx, s->gb.buffer, s->gb.buffer_end - s->gb.buffer) < 0) -diff --git a/libavcodec/h264.c b/libavcodec/h264.c -index 1e6326f..fe76cf7 100644 ---- a/libavcodec/h264.c -+++ b/libavcodec/h264.c -@@ -2746,9 +2746,10 @@ static int field_end(H264Context *h, int in_setup) - ff_thread_report_progress(&s->current_picture_ptr->f, INT_MAX, - s->picture_structure == PICT_BOTTOM_FIELD); - -- if (CONFIG_H264_VDPAU_DECODER && -- s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) -+#if CONFIG_H264_VDPAU_DECODER -+ if (s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) - ff_vdpau_h264_set_reference_frames(s); -+#endif - - if (in_setup || !(avctx->active_thread_type & FF_THREAD_FRAME)) { - if (!s->dropable) { -@@ -2767,9 +2768,11 @@ static int field_end(H264Context *h, int in_setup) - "hardware accelerator failed to decode picture\n"); - } - -+#if CONFIG_H264_VDPAU_DECODER - if (CONFIG_H264_VDPAU_DECODER && - s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) - ff_vdpau_h264_picture_complete(s); -+#endif - - /* - * FIXME: Error handling code does not seem to support interlaced -@@ -4394,9 +4397,11 @@ again: - if (s->avctx->hwaccel && - s->avctx->hwaccel->start_frame(s->avctx, NULL, 0) < 0) - return -1; -+#if CONFIG_H264_VDPAU_DECODER - if (CONFIG_H264_VDPAU_DECODER && - s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) - ff_vdpau_h264_picture_start(s); -+#endif - } - - if (hx->redundant_pic_count == 0 && -@@ -4412,6 +4417,7 @@ again: - &buf[buf_index - consumed], - consumed) < 0) - return -1; -+#if CONFIG_H264_VDPAU_DECODER - } else if (CONFIG_H264_VDPAU_DECODER && - s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) { - static const uint8_t start_code[] = { -@@ -4420,6 +4426,7 @@ again: - sizeof(start_code)); - ff_vdpau_add_data_chunk(s, &buf[buf_index - consumed], - consumed); -+#endif - } else - context_count++; - } -diff --git a/libavcodec/h264dsp.c b/libavcodec/h264dsp.c -index bd35aa3..7b69198 100644 ---- a/libavcodec/h264dsp.c -+++ b/libavcodec/h264dsp.c -@@ -111,7 +111,13 @@ void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, const int chroma_fo - break; - } - -- if (ARCH_ARM) ff_h264dsp_init_arm(c, bit_depth, chroma_format_idc); -- if (HAVE_ALTIVEC) ff_h264dsp_init_ppc(c, bit_depth, chroma_format_idc); -- if (HAVE_MMX) ff_h264dsp_init_x86(c, bit_depth, chroma_format_idc); -+#if (ARCH_ARM) -+ ff_h264dsp_init_arm(c, bit_depth, chroma_format_idc); -+#endif -+#if (HAVE_ALTIVEC) -+ ff_h264dsp_init_ppc(c, bit_depth, chroma_format_idc); -+#endif -+#if (HAVE_MMX) -+ ff_h264dsp_init_x86(c, bit_depth, chroma_format_idc); -+#endif - } -diff --git a/libavcodec/h264pred.c b/libavcodec/h264pred.c -index a174b4c..78e33cb 100644 ---- a/libavcodec/h264pred.c -+++ b/libavcodec/h264pred.c -@@ -532,6 +532,10 @@ void ff_h264_pred_init(H264PredContext *h, int codec_id, const int bit_depth, co - break; - } - -- if (ARCH_ARM) ff_h264_pred_init_arm(h, codec_id, bit_depth, chroma_format_idc); -- if (HAVE_MMX) ff_h264_pred_init_x86(h, codec_id, bit_depth, chroma_format_idc); -+#if (ARCH_ARM) -+ ff_h264_pred_init_arm(h, codec_id, bit_depth, chroma_format_idc); -+#endif -+#if (HAVE_MMX) -+ ff_h264_pred_init_x86(h, codec_id, bit_depth, chroma_format_idc); -+#endif - } -diff --git a/libavcodec/lpc.c b/libavcodec/lpc.c -index 5faddc2..459ec34 100644 ---- a/libavcodec/lpc.c -+++ b/libavcodec/lpc.c -@@ -258,8 +258,9 @@ av_cold int ff_lpc_init(LPCContext *s, int blocksize, int max_order, - s->lpc_apply_welch_window = lpc_apply_welch_window_c; - s->lpc_compute_autocorr = lpc_compute_autocorr_c; - -- if (HAVE_MMX) -+#if (HAVE_MMX) - ff_lpc_init_x86(s); -+#endif - - return 0; - } -diff --git a/libavcodec/mlpdsp.c b/libavcodec/mlpdsp.c -index 7ec8dd2..f1c04c0 100644 ---- a/libavcodec/mlpdsp.c -+++ b/libavcodec/mlpdsp.c -@@ -58,6 +58,7 @@ static void ff_mlp_filter_channel(int32_t *state, const int32_t *coeff, - void ff_mlp_init(DSPContext* c, AVCodecContext *avctx) - { - c->mlp_filter_channel = ff_mlp_filter_channel; -- if (ARCH_X86) -+#if (ARCH_X86) - ff_mlp_init_x86(c, avctx); -+#endif - } -diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c -index bcee1d8..8a8cdac 100644 ---- a/libavcodec/mpeg12.c -+++ b/libavcodec/mpeg12.c -@@ -834,12 +834,14 @@ static int mpeg_decode_mb(MpegEncContext *s, DCTELEM block[12][64]) - memset(s->last_mv, 0, sizeof(s->last_mv)); /* reset mv prediction */ - s->mb_intra = 1; - // if 1, we memcpy blocks in xvmcvideo -+#if CONFIG_XVMC_DECODER - if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1) { - ff_xvmc_pack_pblocks(s, -1); // inter are always full blocks - if (s->swap_uv) { - exchange_uv(s); - } - } -+#endif - - if (s->codec_id == CODEC_ID_MPEG2VIDEO) { - if (s->flags2 & CODEC_FLAG2_FAST) { -@@ -1052,12 +1054,14 @@ static int mpeg_decode_mb(MpegEncContext *s, DCTELEM block[12][64]) - } - - //if 1, we memcpy blocks in xvmcvideo -+#if CONFIG_XVMC_DECODER - if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration > 1) { - ff_xvmc_pack_pblocks(s, cbp); - if (s->swap_uv) { - exchange_uv(s); - } - } -+#endif - - if (s->codec_id == CODEC_ID_MPEG2VIDEO) { - if (s->flags2 & CODEC_FLAG2_FAST) { -@@ -1656,9 +1660,11 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) - - // MPV_frame_start will call this function too, - // but we need to call it on every field -+#if CONFIG_MPEG_XVMC_DECODER - if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) - if (ff_xvmc_field_start(s, avctx) < 0) - return -1; -+#endif - - return 0; - } -diff --git a/libavcodec/mpegaudiodsp.c b/libavcodec/mpegaudiodsp.c -index cc12dd9..b311d21 100644 ---- a/libavcodec/mpegaudiodsp.c -+++ b/libavcodec/mpegaudiodsp.c -@@ -40,7 +40,13 @@ void ff_mpadsp_init(MPADSPContext *s) - s->imdct36_blocks_float = ff_imdct36_blocks_float; - s->imdct36_blocks_fixed = ff_imdct36_blocks_fixed; - -- if (ARCH_ARM) ff_mpadsp_init_arm(s); -- if (HAVE_MMX) ff_mpadsp_init_mmx(s); -- if (HAVE_ALTIVEC) ff_mpadsp_init_altivec(s); -+#if (ARCH_ARM) -+ ff_mpadsp_init_arm(s); -+#endif -+#if (HAVE_MMX) -+ ff_mpadsp_init_mmx(s); -+#endif -+#if (HAVE_ALTIVEC) -+ ff_mpadsp_init_altivec(s); -+#endif - } -diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c -index 705951a..49f52d5 100644 ---- a/libavcodec/mpegvideo.c -+++ b/libavcodec/mpegvideo.c -@@ -1327,8 +1327,10 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) - update_noise_reduction(s); - } - -+#if CONFIG_MPEG_XVMC_DECODER - if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) - return ff_xvmc_field_start(s, avctx); -+#endif - - return 0; - } -@@ -1340,9 +1342,12 @@ void ff_MPV_frame_end(MpegEncContext *s) - int i; - /* redraw edges for the frame if decoding didn't complete */ - // just to make sure that all data is rendered. -+#if CONFIG_MPEG_XVMC_DECODER - if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) { - ff_xvmc_field_end(s); -- } else if((s->error_count || s->encoding || !(s->avctx->codec->capabilities&CODEC_CAP_DRAW_HORIZ_BAND)) && -+ } else -+#endif -+ if((s->error_count || s->encoding || !(s->avctx->codec->capabilities&CODEC_CAP_DRAW_HORIZ_BAND)) && - !s->avctx->hwaccel && - !(s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) && - s->unrestricted_mv && -@@ -2271,10 +2276,12 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], - int lowres_flag, int is_mpeg12) - { - const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; -+#if CONFIG_MPEG_XVMC_DECODER - if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration){ - ff_xvmc_decode_mb(s);//xvmc uses pblocks - return; - } -+#endif - - if(s->avctx->debug&FF_DEBUG_DCT_COEFF) { - /* save DCT coefficients */ -diff --git a/libavcodec/pngdsp.c b/libavcodec/pngdsp.c -index eb8c6b2..989d9eb 100644 ---- a/libavcodec/pngdsp.c -+++ b/libavcodec/pngdsp.c -@@ -44,5 +44,7 @@ void ff_pngdsp_init(PNGDSPContext *dsp) - dsp->add_bytes_l2 = add_bytes_l2_c; - dsp->add_paeth_prediction = ff_add_png_paeth_prediction; - -- if (HAVE_MMX) ff_pngdsp_init_x86(dsp); -+#if (HAVE_MMX) -+ ff_pngdsp_init_x86(dsp); -+#endif - } -diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c -index c29435b..181b4a1 100644 ---- a/libavcodec/pngenc.c -+++ b/libavcodec/pngenc.c -@@ -56,7 +56,8 @@ static void png_get_interlaced_row(uint8_t *dst, int row_size, - uint8_t *d; - const uint8_t *s; - -- mask = (int[]){0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}[pass]; -+ const int tmp[] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}; -+ mask = tmp[pass]; - switch(bits_per_pixel) { - case 1: - memset(dst, 0, row_size); -diff --git a/libavcodec/proresdsp.c b/libavcodec/proresdsp.c -index a21003c..99c22a5 100644 ---- a/libavcodec/proresdsp.c -+++ b/libavcodec/proresdsp.c -@@ -74,7 +74,9 @@ void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx) - dsp->idct_put = prores_idct_put_c; - dsp->idct_permutation_type = FF_NO_IDCT_PERM; - -- if (HAVE_MMX) ff_proresdsp_x86_init(dsp, avctx); -+#if (HAVE_MMX) -+ ff_proresdsp_x86_init(dsp, avctx); -+#endif - - ff_init_scantable_permutation(dsp->idct_permutation, - dsp->idct_permutation_type); -diff --git a/libavcodec/rdft.c b/libavcodec/rdft.c -index ebddd8b..9509bc4 100644 ---- a/libavcodec/rdft.c -+++ b/libavcodec/rdft.c -@@ -122,7 +122,9 @@ av_cold int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans) - #endif - s->rdft_calc = ff_rdft_calc_c; - -- if (ARCH_ARM) ff_rdft_init_arm(s); -+#if (ARCH_ARM) -+ ff_rdft_init_arm(s); -+#endif - - return 0; - } -diff --git a/libavcodec/rv34dsp.c b/libavcodec/rv34dsp.c -index 1ddcea4..b6b380a 100644 ---- a/libavcodec/rv34dsp.c -+++ b/libavcodec/rv34dsp.c -@@ -134,8 +134,10 @@ av_cold void ff_rv34dsp_init(RV34DSPContext *c, DSPContext* dsp) { - c->rv34_idct_add = rv34_idct_add_c; - c->rv34_idct_dc_add = rv34_idct_dc_add_c; - -- if (HAVE_NEON) -+#if (HAVE_NEON) - ff_rv34dsp_init_neon(c, dsp); -- if (HAVE_MMX) -+#endif -+#if (HAVE_MMX) - ff_rv34dsp_init_x86(c, dsp); -+#endif - } -diff --git a/libavcodec/rv40dsp.c b/libavcodec/rv40dsp.c -index 8ba10be..c1bfd95 100644 ---- a/libavcodec/rv40dsp.c -+++ b/libavcodec/rv40dsp.c -@@ -602,8 +602,10 @@ av_cold void ff_rv40dsp_init(RV34DSPContext *c, DSPContext* dsp) { - c->rv40_loop_filter_strength[0] = rv40_h_loop_filter_strength; - c->rv40_loop_filter_strength[1] = rv40_v_loop_filter_strength; - -- if (HAVE_MMX) -+#if (HAVE_MMX) - ff_rv40dsp_init_x86(c, dsp); -- if (HAVE_NEON) -+#endif -+#if (HAVE_NEON) - ff_rv40dsp_init_neon(c, dsp); -+#endif - } -diff --git a/libavcodec/sbrdsp.c b/libavcodec/sbrdsp.c -index 8c88fb3..b3879b9 100644 ---- a/libavcodec/sbrdsp.c -+++ b/libavcodec/sbrdsp.c -@@ -241,8 +241,10 @@ av_cold void ff_sbrdsp_init(SBRDSPContext *s) - s->hf_apply_noise[2] = sbr_hf_apply_noise_2; - s->hf_apply_noise[3] = sbr_hf_apply_noise_3; - -- if (ARCH_ARM) -+#if (ARCH_ARM) - ff_sbrdsp_init_arm(s); -- if (HAVE_MMX) -+#endif -+#if (HAVE_MMX) - ff_sbrdsp_init_x86(s); -+#endif - } -diff --git a/libavcodec/synth_filter.c b/libavcodec/synth_filter.c -index 5f10530..9ecd440 100644 ---- a/libavcodec/synth_filter.c -+++ b/libavcodec/synth_filter.c -@@ -60,5 +60,7 @@ av_cold void ff_synth_filter_init(SynthFilterContext *c) - { - c->synth_filter_float = synth_filter_float; - -- if (ARCH_ARM) ff_synth_filter_init_arm(c); -+#if (ARCH_ARM) -+ ff_synth_filter_init_arm(c); -+#endif - } -diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c -index 4533903..9684360 100644 ---- a/libavcodec/v210dec.c -+++ b/libavcodec/v210dec.c -@@ -63,8 +63,9 @@ static av_cold int decode_init(AVCodecContext *avctx) - - s->unpack_frame = v210_planar_unpack_c; - -- if (HAVE_MMX) -+#if (HAVE_MMX) - v210_x86_init(s); -+#endif - - return 0; - } -@@ -101,8 +102,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, - aligned_input = !((uintptr_t)psrc & 0xf) && !(stride & 0xf); - if (aligned_input != s->aligned_input) { - s->aligned_input = aligned_input; -- if (HAVE_MMX) -+#if (HAVE_MMX) - v210_x86_init(s); -+#endif - } - - if (pic->data[0]) -diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c -index 309194e..6341d98 100644 ---- a/libavcodec/vc1dec.c -+++ b/libavcodec/vc1dec.c -@@ -5545,10 +5545,13 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, - s->me.qpel_put = s->dsp.put_qpel_pixels_tab; - s->me.qpel_avg = s->dsp.avg_qpel_pixels_tab; - -+#if CONFIG_VC1_VDPAU_DECODER - if ((CONFIG_VC1_VDPAU_DECODER) - &&s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU) - ff_vdpau_vc1_decode_picture(s, buf_start, (buf + buf_size) - buf_start); -- else if (avctx->hwaccel) { -+ else -+#endif -+ if (avctx->hwaccel) { - if (avctx->hwaccel->start_frame(avctx, buf, buf_size) < 0) - goto err; - if (avctx->hwaccel->decode_slice(avctx, buf_start, (buf + buf_size) - buf_start) < 0) -diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c -index da7593f..38a28aa 100644 ---- a/libavcodec/vc1dsp.c -+++ b/libavcodec/vc1dsp.c -@@ -846,8 +846,10 @@ av_cold void ff_vc1dsp_init(VC1DSPContext* dsp) { - dsp->sprite_v_double_twoscale = sprite_v_double_twoscale_c; - #endif - -- if (HAVE_ALTIVEC) -+#if (HAVE_ALTIVEC) - ff_vc1dsp_init_altivec(dsp); -- if (HAVE_MMX) -+#endif -+#if (HAVE_MMX) - ff_vc1dsp_init_mmx(dsp); -+#endif - } -diff --git a/libavcodec/vp56dsp.c b/libavcodec/vp56dsp.c -index c629343..51419f6 100644 ---- a/libavcodec/vp56dsp.c -+++ b/libavcodec/vp56dsp.c -@@ -88,6 +88,10 @@ void ff_vp56dsp_init(VP56DSPContext *s, enum CodecID codec) - } - } - -- if (ARCH_ARM) ff_vp56dsp_init_arm(s, codec); -- if (HAVE_MMX) ff_vp56dsp_init_x86(s, codec); -+#if (ARCH_ARM) -+ ff_vp56dsp_init_arm(s, codec); -+#endif -+#if (HAVE_MMX) -+ ff_vp56dsp_init_x86(s, codec); -+#endif - } -diff --git a/libavcodec/vp8dsp.c b/libavcodec/vp8dsp.c -index 1ee070c..8a9af2b 100644 ---- a/libavcodec/vp8dsp.c -+++ b/libavcodec/vp8dsp.c -@@ -520,10 +520,13 @@ av_cold void ff_vp8dsp_init(VP8DSPContext *dsp) - VP8_BILINEAR_MC_FUNC(1, 8); - VP8_BILINEAR_MC_FUNC(2, 4); - -- if (HAVE_MMX) -+#if (HAVE_MMX) - ff_vp8dsp_init_x86(dsp); -- if (HAVE_ALTIVEC) -+#endif -+#if (HAVE_ALTIVEC) - ff_vp8dsp_init_altivec(dsp); -- if (ARCH_ARM) -+#endif -+#if (ARCH_ARM) - ff_vp8dsp_init_arm(dsp); -+#endif - } -diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c -index 86ebfee..f994690 100644 ---- a/libavdevice/alldevices.c -+++ b/libavdevice/alldevices.c -@@ -38,7 +38,9 @@ void avdevice_register_all(void) - initialized = 1; - - /* devices */ -+#if __GNUC__ > 2 - REGISTER_INOUTDEV (ALSA, alsa); -+#endif - REGISTER_INDEV (BKTR, bktr); - REGISTER_INDEV (DSHOW, dshow); - REGISTER_INDEV (DV1394, dv1394); -diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c -index 90e8781..9284f04 100644 ---- a/libavfilter/af_aresample.c -+++ b/libavfilter/af_aresample.c -@@ -103,20 +103,23 @@ static int query_formats(AVFilterContext *ctx) - ff_channel_layouts_ref(in_layouts, &inlink->out_channel_layouts); - - if(out_rate > 0) { -- out_samplerates = avfilter_make_format_list((int[]){ out_rate, -1 }); -+ int tmp[] = {out_rate, -1}; -+ out_samplerates = avfilter_make_format_list(tmp); - } else { - out_samplerates = ff_all_samplerates(); - } - avfilter_formats_ref(out_samplerates, &outlink->in_samplerates); - - if(out_format != AV_SAMPLE_FMT_NONE) { -- out_formats = avfilter_make_format_list((int[]){ out_format, -1 }); -+ int tmp[] = {out_format, -1}; -+ out_formats = avfilter_make_format_list(tmp); - } else - out_formats = avfilter_make_all_formats(AVMEDIA_TYPE_AUDIO); - avfilter_formats_ref(out_formats, &outlink->in_formats); - - if(out_layout) { -- out_layouts = avfilter_make_format64_list((int64_t[]){ out_layout, -1 }); -+ int64_t tmp[] = {out_layout, -1}; -+ out_layouts = avfilter_make_format64_list(tmp); - } else - out_layouts = ff_all_channel_layouts(); - ff_channel_layouts_ref(out_layouts, &outlink->in_channel_layouts); -diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c -index b9d44f2..f1940f1 100644 ---- a/libavfilter/allfilters.c -+++ b/libavfilter/allfilters.c -@@ -43,7 +43,9 @@ void avfilter_register_all(void) - REGISTER_FILTER (ASHOWINFO, ashowinfo, af); - REGISTER_FILTER (ASPLIT, asplit, af); - REGISTER_FILTER (ASTREAMSYNC, astreamsync, af); -+#if __GNUC__ > 2 - REGISTER_FILTER (ASYNCTS, asyncts, af); -+#endif - REGISTER_FILTER (EARWAX, earwax, af); - REGISTER_FILTER (PAN, pan, af); - REGISTER_FILTER (SILENCEDETECT, silencedetect, af); -diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c -index 49e5255..db7a78a 100644 ---- a/libavfilter/vf_gradfun.c -+++ b/libavfilter/vf_gradfun.c -@@ -132,12 +132,18 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) - gf->blur_line = ff_gradfun_blur_line_c; - gf->filter_line = ff_gradfun_filter_line_c; - -+#if HAVE_MMX - if (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX2) - gf->filter_line = ff_gradfun_filter_line_mmx2; -+#endif -+#if HAVE_SSSE3 - if (HAVE_SSSE3 && cpu_flags & AV_CPU_FLAG_SSSE3) - gf->filter_line = ff_gradfun_filter_line_ssse3; -+#endif -+#if HAVE_SSE - if (HAVE_SSE && cpu_flags & AV_CPU_FLAG_SSE2) - gf->blur_line = ff_gradfun_blur_line_sse2; -+#endif - - av_log(ctx, AV_LOG_INFO, "threshold:%.2f radius:%d\n", thresh, gf->radius); - -diff --git a/libavformat/allformats.c b/libavformat/allformats.c -index 1862449..b6fb353 100644 ---- a/libavformat/allformats.c -+++ b/libavformat/allformats.c -@@ -67,7 +67,9 @@ void av_register_all(void) - REGISTER_MUXER (ASF_STREAM, asf_stream); - REGISTER_MUXDEMUX (AU, au); - REGISTER_MUXDEMUX (AVI, avi); -+#if __GNUC__ > 2 - REGISTER_DEMUXER (AVISYNTH, avisynth); -+#endif - REGISTER_MUXER (AVM2, avm2); - REGISTER_DEMUXER (AVS, avs); - REGISTER_DEMUXER (BETHSOFTVID, bethsoftvid); -diff --git a/libavutil/cpu.c b/libavutil/cpu.c -index b911880..edf893e 100644 ---- a/libavutil/cpu.c -+++ b/libavutil/cpu.c -@@ -32,9 +32,15 @@ int av_get_cpu_flags(void) - if (checked) - return flags; - -- if (ARCH_ARM) flags = ff_get_cpu_flags_arm(); -- if (ARCH_PPC) flags = ff_get_cpu_flags_ppc(); -- if (ARCH_X86) flags = ff_get_cpu_flags_x86(); -+#if ARCH_ARM -+ flags = ff_get_cpu_flags_arm(); -+#endif -+#if ARCH_PPC -+ flags = ff_get_cpu_flags_ppc(); -+#endif -+#if ARCH_X86 -+ flags = ff_get_cpu_flags_x86(); -+#endif - - checked = 1; - return flags; -diff --git a/libswresample/audioconvert.c b/libswresample/audioconvert.c -index c531356..40634c6 100644 ---- a/libswresample/audioconvert.c -+++ b/libswresample/audioconvert.c -@@ -154,7 +154,9 @@ AudioConvert *swri_audio_convert_alloc(enum AVSampleFormat out_fmt, - } - } - -- if(HAVE_YASM && HAVE_MMX) swri_audio_convert_init_x86(ctx, out_fmt, in_fmt, channels); -+#if HAVE_YASM && HAVE_MMX -+ swri_audio_convert_init_x86(ctx, out_fmt, in_fmt, channels); -+#endif - - return ctx; - } -diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c -index ba7d6de..5bdc182 100644 ---- a/libswscale/rgb2rgb.c -+++ b/libswscale/rgb2rgb.c -@@ -128,8 +128,9 @@ void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, - void sws_rgb2rgb_init(void) - { - rgb2rgb_init_c(); -- if (HAVE_MMX) -+#if (HAVE_MMX) - rgb2rgb_init_x86(); -+#endif - } - - void rgb32to24(const uint8_t *src, uint8_t *dst, int src_size) -diff --git a/libswscale/swscale.c b/libswscale/swscale.c -index 5dd4124..9901f83 100644 ---- a/libswscale/swscale.c -+++ b/libswscale/swscale.c -@@ -734,10 +734,12 @@ SwsFunc ff_getSwsFunc(SwsContext *c) - { - sws_init_swScale_c(c); - -- if (HAVE_MMX) -+#if (HAVE_MMX) - ff_sws_init_swScale_mmx(c); -- if (HAVE_ALTIVEC) -+#endif -+#if (HAVE_ALTIVEC) - ff_sws_init_swScale_altivec(c); -+#endif - - return swScale; - } -diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c -index 52951e0..b7310d4 100644 ---- a/libswscale/swscale_unscaled.c -+++ b/libswscale/swscale_unscaled.c -@@ -473,36 +473,48 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[], - - switch (c->dstFormat) { - case PIX_FMT_BGR24: -- gbr24ptopacked24((const uint8_t *[]) { src[1], src[0], src[2] }, -- (int []) { srcStride[1], srcStride[0], srcStride[2] }, -+ { -+ const uint8_t * srca[] = { src[1], src[0], src[2] }; -+ int stride[] = { srcStride[1], srcStride[0], srcStride[2] }; -+ gbr24ptopacked24(srca, stride, - dst[0] + srcSliceY * dstStride[0], dstStride[0], - srcSliceH, c->srcW); - break; -+ } - - case PIX_FMT_RGB24: -- gbr24ptopacked24((const uint8_t *[]) { src[2], src[0], src[1] }, -- (int []) { srcStride[2], srcStride[0], srcStride[1] }, -+ { -+ const uint8_t * srca[] = { src[2], src[0], src[1] }; -+ int stride[] = { srcStride[2], srcStride[0], srcStride[1] }; -+ gbr24ptopacked24(srca, stride, - dst[0] + srcSliceY * dstStride[0], dstStride[0], - srcSliceH, c->srcW); - break; -+ } - - case PIX_FMT_ARGB: - alpha_first = 1; - case PIX_FMT_RGBA: -- gbr24ptopacked32((const uint8_t *[]) { src[2], src[0], src[1] }, -- (int []) { srcStride[2], srcStride[0], srcStride[1] }, -+ { -+ const uint8_t * srca[] = { src[2], src[0], src[1] }; -+ int stride[] = { srcStride[2], srcStride[0], srcStride[1] }; -+ gbr24ptopacked32(srca, stride, - dst[0] + srcSliceY * dstStride[0], dstStride[0], - srcSliceH, alpha_first, c->srcW); - break; -+ } - - case PIX_FMT_ABGR: - alpha_first = 1; - case PIX_FMT_BGRA: -- gbr24ptopacked32((const uint8_t *[]) { src[1], src[0], src[2] }, -- (int []) { srcStride[1], srcStride[0], srcStride[2] }, -+ { -+ const uint8_t * srca[] = { src[1], src[0], src[2] }; -+ int stride[] = { srcStride[1], srcStride[0], srcStride[2] }; -+ gbr24ptopacked32(srca, stride, - dst[0] + srcSliceY * dstStride[0], dstStride[0], - srcSliceH, alpha_first, c->srcW); - break; -+ } - - default: - av_log(c, AV_LOG_ERROR, -@@ -981,10 +993,12 @@ void ff_get_unscaled_swscale(SwsContext *c) - c->swScale = planarCopyWrapper; - } - -- if (ARCH_BFIN) -+#if (ARCH_BFIN) - ff_bfin_get_unscaled_swscale(c); -- if (HAVE_ALTIVEC) -+#endif -+#if (HAVE_ALTIVEC) - ff_swscale_get_unscaled_altivec(c); -+#endif - } - - static void reset_ptr(const uint8_t *src[], int format) -diff --git a/libswscale/utils.c b/libswscale/utils.c -index dc489de..31ebda7 100644 ---- a/libswscale/utils.c -+++ b/libswscale/utils.c -@@ -778,9 +778,11 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], - contrast, saturation); - // FIXME factorize - -+#if HAVE_ALTIVEC - if (HAVE_ALTIVEC && av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC) - ff_yuv2rgb_init_tables_altivec(c, inv_table, brightness, - contrast, saturation); -+#endif - return 0; - } - -diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c -index 446b433..9e5e376 100644 ---- a/libswscale/yuv2rgb.c -+++ b/libswscale/yuv2rgb.c -@@ -534,14 +534,15 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c) - { - SwsFunc t = NULL; - -- if (HAVE_MMX) -+#if (HAVE_MMX) - t = ff_yuv2rgb_init_mmx(c); -- else if (HAVE_VIS) -+#elif (HAVE_VIS) - t = ff_yuv2rgb_init_vis(c); -- else if (HAVE_ALTIVEC) -+#elif (HAVE_ALTIVEC) - t = ff_yuv2rgb_init_altivec(c); -- else if (ARCH_BFIN) -+#elif (ARCH_BFIN) - t = ff_yuv2rgb_get_func_ptr_bfin(c); -+#endif - - if (t) - return t; --- -2.2.2 -