*** ./configure.ORIG	Thu Apr  7 20:30:21 2011
--- ./configure	Thu Apr  7 20:32:30 2011
***************
*** 979,984 ****
--- 979,985 ----
  '
  
  ARCH_LIST='
+     AIX
      alpha
      arm
      avr32
***************
*** 1634,1640 ****
  nm_opts='-g'
  
  # machine
! arch_default=$(uname -m)
  cpu="generic"
  
  # OS
--- 1635,1641 ----
  nm_opts='-g'
  
  # machine
! arch_default=$(uname -s)
  cpu="generic"
  
  # OS
***************
*** 1666,1672 ****
  
  # build settings
  SHFLAGS='-shared -Wl,-soname,$$(@F)'
! FFSERVERLDFLAGS=-Wl,-E
  LIBPREF="lib"
  LIBSUF=".a"
  FULLNAME='$(NAME)$(BUILDSUF)'
--- 1667,1673 ----
  
  # build settings
  SHFLAGS='-shared -Wl,-soname,$$(@F)'
! FFSERVERLDFLAGS=
  LIBPREF="lib"
  LIBSUF=".a"
  FULLNAME='$(NAME)$(BUILDSUF)'
***************
*** 2503,2508 ****
--- 2504,2511 ----
          ;;
      gnu)
          ;;
+     aix)
+         ;;
      qnx)
          add_cppflags -D_QNX_SOURCE
          network_extralibs="-lsocket"
***************
*** 2997,3003 ****
  # add some linker flags
  check_ldflags -Wl,--warn-common
  check_ldflags '-Wl,-rpath-link,\$(BUILD_ROOT)/libpostproc -Wl,-rpath-link,\$(BUILD_ROOT)/libswscale -Wl,-rpath-link,\$(BUILD_ROOT)/libavfilter -Wl,-rpath-link,\$(BUILD_ROOT)/libavdevice -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
- test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  
  echo "X{};" > $TMPV
  if test_ldflags -Wl,--version-script,$TMPV; then
--- 3000,3005 ----
*** ./libavformat/udp.c.ORIG	Thu Apr  7 20:32:44 2011
--- ./libavformat/udp.c	Thu Apr  7 20:33:32 2011
***************
*** 43,48 ****
--- 43,52 ----
  #define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
  #endif
  
+ #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61))
+ #define ss_family __ss_family
+ #endif
+ 
  typedef struct {
      int udp_fd;
      int ttl;
*** ./libavcodec/dnxhdenc.c.ORIG	Thu Apr  7 21:33:33 2011
--- ./libavcodec/dnxhdenc.c	Thu Apr  7 21:33:47 2011
***************
*** 36,42 ****
      {"nitris_compat", "encode with Avid Nitris compatibility", offsetof(DNXHDEncContext, nitris_compat), FF_OPT_TYPE_INT, 0, 0, 1, VE},
  {NULL}
  };
! static const AVClass class = { "dnxhd", av_default_item_name, options, LIBAVUTIL_VERSION_INT };
  
  int dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow);
  
--- 36,42 ----
      {"nitris_compat", "encode with Avid Nitris compatibility", offsetof(DNXHDEncContext, nitris_compat), FF_OPT_TYPE_INT, 0, 0, 1, VE},
  {NULL}
  };
! static const AVClass AIXclass = { "dnxhd", av_default_item_name, options, LIBAVUTIL_VERSION_INT };
  
  int dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow);
  
***************
*** 871,875 ****
      dnxhd_encode_end,
      .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV422P, PIX_FMT_NONE},
      .long_name = NULL_IF_CONFIG_SMALL("VC3/DNxHD"),
!     .priv_class = &class,
  };
--- 871,875 ----
      dnxhd_encode_end,
      .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV422P, PIX_FMT_NONE},
      .long_name = NULL_IF_CONFIG_SMALL("VC3/DNxHD"),
!     .priv_class = &AIXclass,
  };
*** ./libavcodec/libvorbis.c.ORIG	Thu Apr  7 21:35:15 2011
--- ./libavcodec/libvorbis.c	Thu Apr  7 21:35:28 2011
***************
*** 58,64 ****
  {"iblock", "Sets the impulse block bias", offsetof(OggVorbisContext, iblock), FF_OPT_TYPE_DOUBLE, 0, -15, 0, AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_ENCODING_PARAM},
  {NULL}
  };
! static const AVClass class = { "libvorbis", av_default_item_name, options, LIBAVUTIL_VERSION_INT };
  
  static av_cold int oggvorbis_init_encoder(vorbis_info *vi, AVCodecContext *avccontext) {
      OggVorbisContext *context = avccontext->priv_data ;
--- 58,64 ----
  {"iblock", "Sets the impulse block bias", offsetof(OggVorbisContext, iblock), FF_OPT_TYPE_DOUBLE, 0, -15, 0, AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_ENCODING_PARAM},
  {NULL}
  };
! static const AVClass AIXclass = { "libvorbis", av_default_item_name, options, LIBAVUTIL_VERSION_INT };
  
  static av_cold int oggvorbis_init_encoder(vorbis_info *vi, AVCodecContext *avccontext) {
      OggVorbisContext *context = avccontext->priv_data ;
***************
*** 254,258 ****
      .capabilities= CODEC_CAP_DELAY,
      .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
      .long_name= NULL_IF_CONFIG_SMALL("libvorbis Vorbis"),
!     .priv_class= &class,
  } ;
--- 254,258 ----
      .capabilities= CODEC_CAP_DELAY,
      .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
      .long_name= NULL_IF_CONFIG_SMALL("libvorbis Vorbis"),
!     .priv_class= &AIXclass,
  } ;
*** ./libavcodec/pthread.c.ORIG	Thu Apr  7 21:38:33 2011
--- ./libavcodec/pthread.c	Thu Apr  7 21:39:28 2011
***************
*** 224,230 ****
      return avcodec_thread_execute(avctx, NULL, arg, ret, job_count, 0);
  }
  
! static int thread_init(AVCodecContext *avctx)
  {
      int i;
      ThreadContext *c;
--- 224,230 ----
      return avcodec_thread_execute(avctx, NULL, arg, ret, job_count, 0);
  }
  
! static int AIXthread_init(AVCodecContext *avctx)
  {
      int i;
      ThreadContext *c;
***************
*** 893,899 ****
          validate_thread_parameters(avctx);
  
          if (avctx->active_thread_type&FF_THREAD_SLICE)
!             return thread_init(avctx);
          else if (avctx->active_thread_type&FF_THREAD_FRAME)
              return frame_thread_init(avctx);
      }
--- 893,899 ----
          validate_thread_parameters(avctx);
  
          if (avctx->active_thread_type&FF_THREAD_SLICE)
!             return AIXthread_init(avctx);
          else if (avctx->active_thread_type&FF_THREAD_FRAME)
              return frame_thread_init(avctx);
      }
*** ./libavformat/rtsp.c.ORIG	Thu Apr  7 21:26:39 2011
--- ./libavformat/rtsp.c	Thu Apr  7 21:27:04 2011
***************
*** 54,59 ****
--- 54,63 ----
  #define SDP_MAX_SIZE 16384
  #define RECVBUF_SIZE 10 * RTP_MAX_PACKET_LENGTH
  
+ #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61))
+ #define ss_family __ss_family
+ #endif
+ 
  static void get_word_until_chars(char *buf, int buf_size,
                                   const char *sep, const char **pp)
  {
*** ./libavformat/sapenc.c.ORIG	Thu Apr  7 21:27:28 2011
--- ./libavformat/sapenc.c	Thu Apr  7 21:27:51 2011
***************
*** 29,34 ****
--- 29,38 ----
  #include "os_support.h"
  #include "rtpenc_chain.h"
  
+ #if (defined(_AIX51) || defined(_AIX52) || defined(_AIX53)) && !(defined(_AIX61))
+ #define ss_family __ss_family
+ #endif
+ 
  struct SAPState {
      uint8_t    *ann;
      int         ann_size;
*** ./libavformat/spdifenc.c.ORIG	Thu Apr  7 21:29:32 2011
--- ./libavformat/spdifenc.c	Thu Apr  7 21:29:59 2011
***************
*** 93,99 ****
  { NULL },
  };
  
! static const AVClass class = { "spdif", av_default_item_name, options, LIBAVUTIL_VERSION_INT };
  
  static int spdif_header_ac3(AVFormatContext *s, AVPacket *pkt)
  {
--- 93,99 ----
  { NULL },
  };
  
! static const AVClass AIXclass = { "spdif", av_default_item_name, options, LIBAVUTIL_VERSION_INT };
  
  static int spdif_header_ac3(AVFormatContext *s, AVPacket *pkt)
  {
***************
*** 547,551 ****
      spdif_write_packet,
      spdif_write_trailer,
      .flags = AVFMT_NOTIMESTAMPS,
!     .priv_class = &class,
  };
--- 547,551 ----
      spdif_write_packet,
      spdif_write_trailer,
      .flags = AVFMT_NOTIMESTAMPS,
!     .priv_class = &AIXclass,
  };
*** ./libavutil/eval.c.ORIG	Thu Apr  7 21:43:37 2011
--- ./libavutil/eval.c	Thu Apr  7 21:44:22 2011
***************
*** 46,52 ****
      double var[VARS];
  } Parser;
  
! static const AVClass class = { "Eval", av_default_item_name, NULL, LIBAVUTIL_VERSION_INT, offsetof(Parser,log_offset), offsetof(Parser,log_ctx) };
  
  static const int8_t si_prefixes['z' - 'E' + 1] = {
      ['y'-'E']= -24,
--- 46,52 ----
      double var[VARS];
  } Parser;
  
! static const AVClass AIXclass = { "Eval", av_default_item_name, NULL, LIBAVUTIL_VERSION_INT, offsetof(Parser,log_offset), offsetof(Parser,log_ctx) };
  
  static const int8_t si_prefixes['z' - 'E' + 1] = {
      ['y'-'E']= -24,
***************
*** 464,470 ****
          if (!isspace(*s++)) *wp++ = s[-1];
      *wp++ = 0;
  
!     p.class      = &class;
      p.stack_index=100;
      p.s= w;
      p.const_names = const_names;
--- 464,470 ----
          if (!isspace(*s++)) *wp++ = s[-1];
      *wp++ = 0;
  
!     p.class      = &AIXclass;
      p.stack_index=100;
      p.s= w;
      p.const_names = const_names;
