To build this modified version of mplayer/mencoder:

1) Unpack the SVN snapshot to a temporary directory:
    $ mkdir build
    $ (cd build && tar -jxvf ../mplayer_r29460.tar.bz2)

2) Copy the new files into the tree
    $ cp patch/new_files/libmpdemux/* build/libmpdemux

3) Apply patches:
    NOTE: These patches are based on the sources included in the archive above.
    NOTE: They will NOT work properly with sources obtained elsewhere.
    There are two methods of applying the needed patches. Choose one.

    Method 1: Apply patches individually
    $ cd build
    $ patch -p0 -l < ../patch/ad_faad-restrict_aac_probe_adts.diff
    $ patch -p0 -l < ../patch/add_ogg_mux_demux.diff
    $ patch -p0 -l < ../patch/asf-correct_movielength.diff
    $ patch -p0 -l < ../patch/asf-use_avg_frame_time.diff
    $ patch -p0 -l < ../patch/asfheader-force_best_stream.diff
    $ patch -p0 -l < ../patch/avi_check_idxflags.diff
    $ patch -p0 -l < ../patch/codecs_conf-workarounds.diff
    $ patch -p0 -l < ../patch/configure-static.diff
    $ patch -p0 -l < ../patch/demux_avi-forceidx_fallback.diff
    $ patch -p0 -l < ../patch/demux_lavf-ID_VIDEO_ROTATION.diff
    $ patch -p0 -l < ../patch/demux_lavf-add_dv_mts_preferred.diff
    $ patch -p0 -l < ../patch/demux_lavf-probe_small_files.diff
    $ patch -p0 -l < ../patch/demux_mpg-short_video_fix.diff
    $ patch -p0 -l < ../patch/libavformat_mov-avoid_reporting_empty_av_streams.diff
    $ patch -p0 -l < ../patch/libavformat_mov-track_rotation_metadata.diff
    $ patch -p0 -l < ../patch/mencoder-ext_file_conf.diff
    $ patch -p0 -l < ../patch/mencoder_01_identify.diff
    $ patch -p0 -l < ../patch/mencoder_02_audio_only_hack.diff
    $ patch -p0 -l < ../patch/mencoder_03_joint_av_eof.diff
    $ patch -p0 -l < ../patch/mencoder_04_av_sync_hack.diff
    $ patch -p0 -l < ../patch/mencoder_05_mov_lavf_pts_var_fps.diff
    $ patch -p0 -l < ../patch/mencoder_06_asf_pts_passing.diff
    $ patch -p0 -l < ../patch/mencoder_07_demux_update_pts.diff
    $ patch -p0 -l < ../patch/mencoder_08_decoded_before_dups.diff
    $ patch -p0 -l < ../patch/mencoder_09_rebase_pts_when_seeking.diff
    $ patch -p0 -l < ../patch/mencoder_10_correct_pts.diff
    $ patch -p0 -l < ../patch/mov-ignore_reference_trak.diff
    $ patch -p0 -l < ../patch/mov_01_edl_kf_search.diff
    $ patch -p0 -l < ../patch/mov_02_mean_framerate.diff
    $ patch -p0 -l < ../patch/mov_03_moof_fragments.diff
    $ patch -p0 -l < ../patch/mov_04_mvhd_length.diff
    $ patch -p0 -l < ../patch/mov_05_ffmpeg_bitrate.diff
    $ patch -p0 -l < ../patch/mov_06_tkhd_matrix_scale.diff
    $ patch -p0 -l < ../patch/mov_07_increase_sample_pts_size.diff
    $ patch -p0 -l < ../patch/mp3lib-increase_maxframesize.diff
    $ patch -p0 -l < ../patch/mp3lib-validate_winarray_index.diff
    $ patch -p0 -l < ../patch/mpegvideo-revert_r18381.diff
    $ patch -p0 -l < ../patch/reduce_spurious_logging.diff
    $ patch -p0 -l < ../patch/stream_file-clear_eof_on_seek.diff
    $ patch -p0 -l < ../patch/vd_ffmpeg-restrict_dimension_correction.diff
    $ patch -p0 -l < ../patch/vd_qtvideo-validate_ImageDesc_size.diff
    $ patch -p0 -l < ../patch/ve_raw-stride_support.diff
    $ patch -p0 -l < ../patch/version.diff
    $ patch -p0 -l < ../patch/vf_vo-stride_support.diff

    Method 2: Use the shell
    $ cd build
    $ for f in ../patch/*.diff ../patch/*.patch; do patch -p0 -l < $f; done

4) Configure: (TODO: Add in the proper codecs/prefix path)
    $ ./configure \
      --enable-static \
      --enable-runtime-cpudetection \
      --enable-largefiles \
      --disable-tremor-internal \
      --extra-libs=-logg \
      --codecsdir=/usr/local/lib/codecs \
      --prefix=/opt/on2/flixengine/mencoder
    Patch the generated config.mak to allow selective static linking reducing
    target dependencies while still allowing use of the binary codecs.
    NOTE: this step is only necessary if using the '--enable-static' option.
    $ ../postconfig-static.sh

5) Build and install:
    $ make
    $ sudo make install
