To build this modified version of mplayer/mencoder:

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

2) Copy the new files into the tree
    $ cp 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 < ../add_ogg_mux_demux.diff
    $ patch -p0 < ../avi_forceidx_fallback.diff
    $ patch -p0 < ../configure-static.diff
    $ patch -p0 < ../demux_increase_buffer.diff
    $ patch -p0 < ../demux_mpg_short_video_fix.diff
    $ patch -p0 < ../ffmpeg_correct_dimensions.diff
    $ patch -p0 < ../mencoder_01_identify.diff
    $ patch -p0 < ../mencoder_02_audio_only_hack.diff
    $ patch -p0 < ../mencoder_03_audio_eof.diff
    $ patch -p0 < ../mencoder_04_av_sync_hack.diff
    $ patch -p0 < ../mencoder_05_lavf_var_fps.diff
    $ patch -p0 < ../mov_01_edl_kf_search.diff
    $ patch -p0 < ../mov_02_mean_framerate.diff
    $ patch -p0 < ../mov_03_moof_fragments.diff
    $ patch -p0 < ../vd_incompatible_vo_warn_msg_level.diff
    $ patch -p0 < ../ve_raw_stride_support.diff
    $ patch -p0 < ../version.diff
    $ patch -p0 < ../vf_vo_stride_support.diff
    $ patch -p0 < ../vo_fonts_warn_msg_level.diff
    $ patch -p0 < ../vp6\[01\]_use_vfw.diff
    $ patch -p0 < ../wmv_remove_yv12.diff

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

4) Configure: (TODO: Add in the proper prefix path)
    $ ./configure \
      --enable-static \
      --enable-runtime-cpudetection \
      --enable-largefiles \
      --disable-tremor-internal \
      --prefix=/opt/on2/flixengine/mencoder
    Patch the generated config.mak to allow for selective static linking to
    reduce 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
