From 55fbfc92a1386262146310eb8bdae7ade26329fc Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 27 Dec 2015 19:53:09 +0100 Subject: [PATCH] ffmpeg 0.10.16: more trying to link properly for gcc2. --- media-video/ffmpeg/ffmpeg-0.10.16.recipe | 2 +- .../ffmpeg/patches/ffmpeg-0.10.16.patchset | 1667 +++++++++++++++++ 2 files changed, 1668 insertions(+), 1 deletion(-) create mode 100644 media-video/ffmpeg/patches/ffmpeg-0.10.16.patchset diff --git a/media-video/ffmpeg/ffmpeg-0.10.16.recipe b/media-video/ffmpeg/ffmpeg-0.10.16.recipe index f989cd8e0..74e60614a 100644 --- a/media-video/ffmpeg/ffmpeg-0.10.16.recipe +++ b/media-video/ffmpeg/ffmpeg-0.10.16.recipe @@ -14,7 +14,7 @@ REVISION="1" SOURCE_DIR="ffmpeg-$portVersion" ARCHITECTURES="x86_gcc2 !x86 !x86_64" SECONDARY_ARCHITECTURES="x86_gcc2 !x86" -PATCHES="ffmpeg-0.10.14.patchset" +PATCHES="ffmpeg-$portVersion.patchset" PROVIDES=" ffmpeg$secondaryArchSuffix = $portVersion compat >= 0.10 diff --git a/media-video/ffmpeg/patches/ffmpeg-0.10.16.patchset b/media-video/ffmpeg/patches/ffmpeg-0.10.16.patchset new file mode 100644 index 000000000..2e1544a1b --- /dev/null +++ b/media-video/ffmpeg/patches/ffmpeg-0.10.16.patchset @@ -0,0 +1,1667 @@ +From 93bf7e38f5566a5a262729d81938c762c4bef60c 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 c76ae51..d7fa5aa 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 520631f..ad98eb0 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 d66dcfd..e42a96d 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 779e4b7..872391a 100644 +--- a/libavcodec/apedec.c ++++ b/libavcodec/apedec.c +@@ -134,6 +134,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 +@@ -184,14 +185,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); +@@ -215,7 +228,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); +@@ -820,7 +832,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; + +@@ -892,7 +906,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; + +@@ -908,11 +921,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 988e819..7893a63 100644 +--- a/libavcodec/h264.c ++++ b/libavcodec/h264.c +@@ -2522,8 +2522,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) { +@@ -2541,8 +2543,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 +@@ -4097,8 +4101,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 +@@ -4110,11 +4116,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 458d2e4..f82406a 100644 +--- a/libavcodec/mpegvideo.c ++++ b/libavcodec/mpegvideo.c +@@ -1327,8 +1327,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; + } +@@ -1340,9 +1342,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 e3854ff..99a4757 100644 +--- a/libavcodec/x86/h264dsp_mmx.c ++++ b/libavcodec/x86/h264dsp_mmx.c +@@ -420,6 +420,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; +@@ -428,6 +429,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 3d65bca..23151d2 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 18ee4b14c3a024184d6146a72ecd6408c1af4141 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 f82406a..fcd7a7a 100644 +--- a/libavcodec/mpegvideo.c ++++ b/libavcodec/mpegvideo.c +@@ -1343,7 +1343,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 +@@ -2276,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 && 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 + + +From 3f1174fee00fbcff6b453339d1160fb7231290d9 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..1c50614 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); ++#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); +@@ -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); +-- +2.2.2 +