Hey folks,

Everything on the list is now building ok on 14.1 here, both x86_64
and i686, but -current needs more work.

The problems were fixed as follows:

audio/audacity -- fixed with John V's patch
audio/mpd -- fixed with John V's upversion
games/alephone -- fixed with John V's patch on 14.1 *but* fails on -current
games/dolphin-emu -- fixed by removing the existing patch
multimedia/bombono-dvd -- fixed with John V's patch
multimedia/cinelerra -- needs lame and x264 in REQUIRES
multimedia/transcode -- needs lame in REQUIRES
network/imageshack-uploader -- fixed thanks to Willy
system/ZoneMinder -- fixed thanks to Willy, *note* it seems to need -j1 on 14.1

Commits for most of those are attached -- but there will be more later
when I get -current sorted out.

Thanks everybody!
-D.
From 6ffe71b16c356ef667da430508109fed2a2c329e Mon Sep 17 00:00:00 2001
From: David Spencer <baildon.resea...@googlemail.com>
Date: Wed, 27 May 2015 10:58:53 +0100
Subject: [PATCH 06/15] games/alephone: Patched for ffmpeg-2.6.3.

Signed-off-by: David Spencer <baildon.resea...@googlemail.com>
---
 games/alephone/alephone.SlackBuild |   8 +
 games/alephone/r5009.diff          | 385 +++++++++++++++++++++++++++
 games/alephone/r5010.diff          |  13 +
 games/alephone/r5013.diff          |  14 +
 games/alephone/r5033.diff          | 514 +++++++++++++++++++++++++++++++++++++
 games/alephone/r5037.diff          | 193 ++++++++++++++
 6 files changed, 1127 insertions(+)
 create mode 100644 games/alephone/r5009.diff
 create mode 100644 games/alephone/r5010.diff
 create mode 100644 games/alephone/r5013.diff
 create mode 100644 games/alephone/r5033.diff
 create mode 100644 games/alephone/r5037.diff

diff --git a/games/alephone/alephone.SlackBuild b/games/alephone/alephone.SlackBuild
index a59807e..73d2a82 100644
--- a/games/alephone/alephone.SlackBuild
+++ b/games/alephone/alephone.SlackBuild
@@ -58,6 +58,14 @@ find -L . \
 # Patch came from ArchLinux AUR, this is the two ffmpeg patches catted
 # together.
 patch -p1 < $CWD/ffmpeg_api.diff
+# Thanks to John Vogel for these ffmpeg patches:
+patch -p0 < $CWD/r5009.diff
+patch -p0 < $CWD/r5010.diff
+patch -p0 < $CWD/r5013.diff
+patch -p0 < $CWD/r5033.diff
+patch -p0 < $CWD/r5037.diff
+
+autoreconf
 
 [ "${FFMPEG:-yes}" = "no" ] && EXTRAOPT=--disable-ffmpeg
 
diff --git a/games/alephone/r5009.diff b/games/alephone/r5009.diff
new file mode 100644
index 0000000..39f9e64
--- /dev/null
+++ b/games/alephone/r5009.diff
@@ -0,0 +1,385 @@
+Index: Source_Files/Sound/FFmpegDecoder.cpp
+===================================================================
+--- Source_Files/Sound/FFmpegDecoder.cpp	(revision 5008)
++++ Source_Files/Sound/FFmpegDecoder.cpp	(revision 5009)
+@@ -199,10 +199,13 @@
+     
+     while (pkt_temp.size > 0)
+     {
+-        AVFrame frame;
+-        avcodec_get_frame_defaults(&frame);
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,28,0)
++        AVFrame *dframe = avcodec_alloc_frame();
++#else
++        AVFrame *dframe = av_frame_alloc();
++#endif
+         int got_frame = 0;
+-        int bytes_read = avcodec_decode_audio4(dec_ctx, &frame, &got_frame, &pkt_temp);
++        int bytes_read = avcodec_decode_audio4(dec_ctx, dframe, &got_frame, &pkt_temp);
+         if (bytes_read < 0)
+         {
+             av_free_packet(&pkt);
+@@ -216,12 +219,12 @@
+             
+             int stride = -1;
+             if (channels > 1 && av_sample_fmt_is_planar(in_fmt))
+-                stride = frame.extended_data[1] - frame.extended_data[0];
++                stride = dframe->extended_data[1] - dframe->extended_data[0];
+ 
+-            int written = convert_audio(frame.nb_samples, channels,
++            int written = convert_audio(dframe->nb_samples, channels,
+                                         stride,
+-                                        in_fmt, frame.extended_data[0],
+-                                        frame.nb_samples, channels,
++                                        in_fmt, dframe->extended_data[0],
++                                        dframe->nb_samples, channels,
+                                         -1,
+                                         out_fmt, av->temp_data);
+             
+@@ -230,6 +233,12 @@
+             pkt_temp.data += bytes_read;
+             pkt_temp.size -= bytes_read;
+         }
++        
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,28,0)
++        av_freep(&dframe);
++#else
++        av_frame_free(&dframe);
++#endif
+     }
+     
+     av_free_packet(&pkt);
+Index: Source_Files/FFmpeg/Movie.cpp
+===================================================================
+--- Source_Files/FFmpeg/Movie.cpp	(revision 5008)
++++ Source_Files/FFmpeg/Movie.cpp	(revision 5009)
+@@ -85,6 +85,15 @@
+ }
+ #endif
+ 
++// FFmpeg compatibility
++#ifndef AV_CODEC_ID_VP8
++#define AV_CODEC_ID_VP8 CODEC_ID_VP8
++#endif
++#ifndef AV_CODEC_ID_VORBIS
++#define AV_CODEC_ID_VORBIS CODEC_ID_VORBIS
++#endif
++
++
+ // shamelessly stolen from SDL 2.0
+ static int get_cpu_count(void)
+ {
+@@ -399,7 +408,7 @@
+     AVStream *video_stream;
+     if (success)
+     {
+-        video_codec = avcodec_find_encoder(CODEC_ID_VP8);
++        video_codec = avcodec_find_encoder(AV_CODEC_ID_VP8);
+         success = video_codec;
+         if (!success) err_msg = "Could not find VP8 encoder";
+     }
+@@ -445,7 +454,11 @@
+     }
+     if (success)
+     {
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,28,0)
+         av->video_frame = avcodec_alloc_frame();
++#else
++        av->video_frame = av_frame_alloc();
++#endif
+         success = av->video_frame;
+         if (!success) err_msg = "Could not allocate video frame";
+     }
+@@ -466,7 +479,7 @@
+     AVStream *audio_stream;
+     if (success)
+     {
+-        audio_codec = avcodec_find_encoder(CODEC_ID_VORBIS);
++        audio_codec = avcodec_find_encoder(AV_CODEC_ID_VORBIS);
+         success = audio_codec;
+         if (!success) err_msg = "Could not find Vorbis encoder";
+     }
+@@ -511,7 +524,11 @@
+     }
+     if (success)
+     {
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,28,0)
+         av->audio_frame = avcodec_alloc_frame();
++#else
++        av->audio_frame = av_frame_alloc();
++#endif
+         success = av->audio_frame;
+         if (!success) err_msg = "Could not allocate audio frame";
+     }
+@@ -550,6 +567,7 @@
+     // Start movie file
+     if (success)
+     {
++        video_stream->time_base = (AVRational){1, TICKS_PER_SECOND};
+         avformat_write_header(av->fmt_ctx, NULL);
+     }
+     
+@@ -615,13 +633,15 @@
+     while (!done)
+     {
+         // add video
+-        int vsize = avcodec_encode_video(vcodec,
+-                                         av->video_buf, av->video_bufsize,
+-                                         frame);
++        AVPacket pkt;
++        av_init_packet(&pkt);
++        pkt.data = av->video_buf;
++        pkt.size = av->video_bufsize;
++        
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54,0,0)
++        int vsize = avcodec_encode_video(vcodec, av->video_buf, av->video_bufsize, frame);
+         if (vsize > 0)
+         {
+-            AVPacket pkt;
+-            av_init_packet(&pkt);
+             if (vcodec->coded_frame->pts != AV_NOPTS_VALUE)
+             {
+                 pkt.pts = av_rescale_q(vcodec->coded_frame->pts,
+@@ -630,12 +650,19 @@
+             }
+             if (vcodec->coded_frame->key_frame)
+                 pkt.flags |= AV_PKT_FLAG_KEY;
++            pkt.size = vsize;
++        }
++
++#else
++        int got_packet = 0;
++        int vsize = avcodec_encode_video2(vcodec, &pkt, frame, &got_packet);
++#endif
++        if (vsize > 0)
++        {
+             pkt.stream_index = vstream->index;
+-            pkt.data = av->video_buf;
+-            pkt.size = vsize;
+             av_interleaved_write_frame(av->fmt_ctx, &pkt);
+-            av_free_packet(&pkt);
+         }
++        av_free_packet(&pkt);
+         
+         if (!last || vsize <= 0)
+             done = true;
+@@ -679,7 +706,11 @@
+                       write_samples, acodec->channels, write_samples * write_bps,
+                       acodec->sample_fmt, av->audio_data_conv);
+                       
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,28,1)
+         avcodec_get_frame_defaults(av->audio_frame);
++#else
++        av_frame_unref(av->audio_frame);
++#endif
+         av->audio_frame->nb_samples = write_samples;
+         int asize = avcodec_fill_audio_frame(av->audio_frame, acodec->channels,
+                                              acodec->sample_fmt,
+@@ -695,7 +726,7 @@
+             if (0 == avcodec_encode_audio2(acodec, &pkt, av->audio_frame, &got_pkt)
+                 && got_pkt)
+             {
+-                if (acodec->coded_frame->pts != AV_NOPTS_VALUE)
++                if (acodec->coded_frame && acodec->coded_frame->pts != AV_NOPTS_VALUE)
+                 {
+                     pkt.pts = av_rescale_q(acodec->coded_frame->pts,
+                                            acodec->time_base,
+Index: Source_Files/FFmpeg/SDL_ffmpeg.c
+===================================================================
+--- Source_Files/FFmpeg/SDL_ffmpeg.c	(revision 5008)
++++ Source_Files/FFmpeg/SDL_ffmpeg.c	(revision 5009)
+@@ -48,6 +48,38 @@
+ }
+ #endif
+ 
++// FFmpeg compatibility
++#ifndef AV_CODEC_ID_MPEG1VIDEO
++#define AV_CODEC_ID_MPEG1VIDEO CODEC_ID_MPEG1VIDEO
++#endif
++#ifndef AV_CODEC_ID_MPEG2VIDEO
++#define AV_CODEC_ID_MPEG2VIDEO CODEC_ID_MPEG2VIDEO
++#endif
++#ifndef AV_CODEC_ID_MP2
++#define AV_CODEC_ID_MP2 CODEC_ID_MP2
++#endif
++#ifndef AV_CODEC_ID_DVVIDEO
++#define AV_CODEC_ID_DVVIDEO CODEC_ID_DVVIDEO
++#endif
++#ifndef AV_CODEC_ID_DVAUDIO
++#define AV_CODEC_ID_DVAUDIO CODEC_ID_DVAUDIO
++#endif
++#ifndef AV_CODEC_ID_PCM_S16LE
++#define AV_CODEC_ID_PCM_S16LE CODEC_ID_PCM_S16LE
++#endif
++#ifndef AV_CODEC_ID_PCM_S16BE
++#define AV_CODEC_ID_PCM_S16BE CODEC_ID_PCM_S16BE
++#endif
++#ifndef AV_CODEC_ID_PCM_U16LE
++#define AV_CODEC_ID_PCM_U16LE CODEC_ID_PCM_U16LE
++#endif
++#ifndef AV_CODEC_ID_PCM_U16BE
++#define AV_CODEC_ID_PCM_U16BE CODEC_ID_PCM_U16BE
++#endif
++#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
++#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000
++#endif
++
+ #include "SDL_ffmpeg.h"
+ 
+ #ifdef MSVC
+@@ -169,12 +201,12 @@
+ 
+ const SDL_ffmpegCodec SDL_ffmpegCodecPALDVD =
+ {
+-    CODEC_ID_MPEG2VIDEO,
++    AV_CODEC_ID_MPEG2VIDEO,
+     720, 576,
+     1, 25,
+     6000000,
+     -1, -1,
+-    CODEC_ID_MP2,
++    AV_CODEC_ID_MP2,
+     2, 48000,
+     192000,
+     -1, -1
+@@ -182,12 +214,12 @@
+ 
+ const SDL_ffmpegCodec SDL_ffmpegCodecPALDV =
+ {
+-    CODEC_ID_DVVIDEO,
++    AV_CODEC_ID_DVVIDEO,
+     720, 576,
+     1, 25,
+     6553600,
+     -1, -1,
+-    CODEC_ID_DVAUDIO,
++    AV_CODEC_ID_DVAUDIO,
+     2, 48000,
+     256000,
+     -1, -1
+@@ -324,7 +356,11 @@
+     {
+         if ( file->type == SDL_ffmpegInputStream )
+         {
++#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53,17,0)
+             av_close_input_file( file->_ffmpeg );
++#else
++            avformat_close_input( &file->_ffmpeg );
++#endif
+         }
+         else if ( file->type == SDL_ffmpegOutputStream )
+         {
+@@ -448,7 +484,11 @@
+                 {
+                     stream->mutex = SDL_CreateMutex();
+ 
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,28,0)
+                     stream->decodeFrame = avcodec_alloc_frame();
++#else
++                    stream->decodeFrame = av_frame_alloc();
++#endif
+ 
+                     SDL_ffmpegStream **s = &file->vs;
+                     while ( *s )
+@@ -1301,11 +1341,17 @@
+ {
+     if ( stream && stream->_ffmpeg && stream->_ffmpeg->codec )
+     {
+-        if ( nominator ) *nominator = stream->_ffmpeg->r_frame_rate.num;
++        AVRational frate;
++#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(55,12,100)
++        frate = stream->_ffmpeg->r_frame_rate;
++#else
++        frate = av_stream_get_r_frame_rate(stream->_ffmpeg);
++#endif
++        if ( nominator ) *nominator = frate.num;
+ 
+-        if ( denominator ) *denominator = stream->_ffmpeg->r_frame_rate.den;
++        if ( denominator ) *denominator = frate.den;
+ 
+-        return ( float )stream->_ffmpeg->r_frame_rate.num / stream->_ffmpeg->r_frame_rate.den;
++        return ( float )frate.num / frate.den;
+     }
+     else
+     {
+@@ -1587,13 +1633,13 @@
+     stream->codec->pix_fmt = PIX_FMT_YUV420P;
+ 
+     /* set mpeg2 codec parameters */
+-    if ( stream->codec->codec_id == CODEC_ID_MPEG2VIDEO )
++    if ( stream->codec->codec_id == AV_CODEC_ID_MPEG2VIDEO )
+     {
+         stream->codec->max_b_frames = 2;
+     }
+ 
+     /* set mpeg1 codec parameters */
+-    if ( stream->codec->codec_id == CODEC_ID_MPEG1VIDEO )
++    if ( stream->codec->codec_id == AV_CODEC_ID_MPEG1VIDEO )
+     {
+         /* needed to avoid using macroblocks in which some coeffs overflow
+            this doesnt happen with normal video, it just happens here as the
+@@ -1757,10 +1803,10 @@
+ 
+             switch ( stream->codec->codec_id )
+             {
+-                case CODEC_ID_PCM_S16LE:
+-                case CODEC_ID_PCM_S16BE:
+-                case CODEC_ID_PCM_U16LE:
+-                case CODEC_ID_PCM_U16BE:
++                case AV_CODEC_ID_PCM_S16LE:
++                case AV_CODEC_ID_PCM_S16BE:
++                case AV_CODEC_ID_PCM_U16LE:
++                case AV_CODEC_ID_PCM_U16BE:
+                     str->encodeAudioInputSize >>= 1;
+                     break;
+                 default:
+@@ -2032,19 +2078,41 @@
+     while ( size > 0 )
+     {
+         /* Decode the packet */
+-
+-#if ( LIBAVCODEC_VERSION_MAJOR <= 52 && LIBAVCODEC_VERSION_MINOR <= 20 )
+-        int len = avcodec_decode_audio2( file->audioStream->_ffmpeg->codec, ( int16_t* )file->audioStream->sampleBuffer, &audioSize, pack->data, pack->size );
+-#else
+-        int len = avcodec_decode_audio3( file->audioStream->_ffmpeg->codec, ( int16_t* )file->audioStream->sampleBuffer, &audioSize, pack );
++        AVCodecContext *avctx = file->audioStream->_ffmpeg->codec;
++        AVFrame dframe;
++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,28,1)
++        avcodec_get_frame_defaults(&dframe);
+ #endif
+-
+-        /* if an error occured, we skip the frame */
+-        if ( len <= 0 || !audioSize )
++        int got_frame = 0;
++        int len = avcodec_decode_audio4( avctx, &dframe, &got_frame, pack );
++        
++        if (len < 0 || !got_frame)
+         {
+             SDL_ffmpegSetError( "error decoding audio frame" );
+             break;
+         }
++        
++        int planar = av_sample_fmt_is_planar( avctx->sample_fmt );
++        int plane_size;
++        int data_size = av_samples_get_buffer_size( &plane_size, avctx->channels, dframe.nb_samples, avctx->sample_fmt, 1 );
++        if ( data_size > 10000 )
++        {
++            SDL_ffmpegSetError( "too much data in decoded audio frame" );
++            break;
++        }
++        memcpy( file->audioStream->sampleBuffer, dframe.extended_data[0], plane_size );
++        audioSize = plane_size;
++        if ( planar && avctx->channels > 1 )
++        {
++            int8_t *out = file->audioStream->sampleBuffer + plane_size;
++            int ch;
++            for ( ch = 1; ch < avctx->channels; ch++ )
++            {
++                memcpy( out, dframe.extended_data[ch], plane_size );
++                out += plane_size;
++                audioSize += plane_size;
++            }
++        }
+ 
+         /* change pointers */
+         data += len;
diff --git a/games/alephone/r5010.diff b/games/alephone/r5010.diff
new file mode 100644
index 0000000..ff01042
--- /dev/null
+++ b/games/alephone/r5010.diff
@@ -0,0 +1,13 @@
+Index: configure.ac
+===================================================================
+--- configure.ac	(revision 5009)
++++ configure.ac	(revision 5010)
+@@ -195,7 +195,7 @@
+ 
+ if [[ "x$enable_ffmpeg" = "xyes" ]]; then
+ dnl Check for libavcodec
+-PKG_CHECK_MODULES([FFMPEG], [libavcodec >= 53.35.0 libavformat >= 53.21.0 libavutil >= 51.22.0 libswscale >= 2.1.0], [
++PKG_CHECK_MODULES([FFMPEG], [libavcodec >= 53.61.100 libavformat >= 53.32.100 libavutil >= 51.35.100 libswscale >= 2.1.100], [
+ 			    CPPFLAGS="$FFMPEG_CFLAGS $CPPFLAGS"
+ 			    LIBS="$FFMPEG_LIBS $LIBS"
+ 			    AC_DEFINE(HAVE_FFMPEG, 1, [ffmpeg support enabled])
diff --git a/games/alephone/r5013.diff b/games/alephone/r5013.diff
new file mode 100644
index 0000000..48f621d
--- /dev/null
+++ b/games/alephone/r5013.diff
@@ -0,0 +1,14 @@
+Index: Source_Files/Sound/FFmpegDecoder.cpp
+===================================================================
+--- Source_Files/Sound/FFmpegDecoder.cpp	(revision 5012)
++++ Source_Files/Sound/FFmpegDecoder.cpp	(revision 5013)
+@@ -21,6 +21,9 @@
+  
+  */
+ 
++// make FFmpeg happy
++#define __STDC_CONSTANT_MACROS
++
+ #include "FFmpegDecoder.h"
+ 
+ #ifdef HAVE_FFMPEG
diff --git a/games/alephone/r5033.diff b/games/alephone/r5033.diff
new file mode 100644
index 0000000..54f7ea3
--- /dev/null
+++ b/games/alephone/r5033.diff
@@ -0,0 +1,514 @@
+Index: configure.ac
+===================================================================
+--- configure.ac	(revision 5032)
++++ configure.ac	(revision 5033)
+@@ -1,9 +1,13 @@
+ dnl Process this file with autoconf to produce a configure script.
+-dnl Written in 2000 by Christian Bauer <christian.ba...@uni-mainz.de>
++dnl Written by Christian Bauer and the Aleph One developers.
+ 
+-AC_INIT([Aleph One/SDL], m4_esyscmd([ grep '^#define A1_DATE_VERSION' Source_Files/Misc/alephversion.h | sed -e 's/\(.*\"\)\(.*\)\(\"\)/\2/g' | tr -d '\n']), [http://sourceforge.net/bugs/?group_id=1997], [AlephOne])
++AC_INIT([Aleph One],
++        m4_esyscmd([ grep '^#define A1_DATE_VERSION' Source_Files/Misc/alephversion.h | sed -e 's/\(.*\"\)\(.*\)\(\"\)/\2/g' | tr -d '\n']),
++        [http://sourceforge.net/p/marathon/bugs/],
++        [AlephOne],
++        [http://marathon.sourceforge.net/])
+ AC_CONFIG_SRCDIR([Source_Files/shell.cpp])
+-AC_PREREQ(2.52)
++AC_PREREQ([2.65])
+ 
+ dnl Detect the canonical host and target build environment.
+ AC_CANONICAL_HOST
+@@ -11,288 +15,212 @@
+ 
+ dnl Init automake.
+ AM_INIT_AUTOMAKE
+-AM_CONFIG_HEADER(config.h)
++AM_CONFIG_HEADER([config.h])
+ 
+ dnl Configure options.
+-AC_ARG_ENABLE(opengl, 
+-[  --enable-opengl         use OpenGL for rendering [default=yes]], , enable_opengl=yes)
+-AC_ARG_ENABLE(mad, 
+-[  --enable-mad            use libmad for mp3 playback [default=yes]], , enable_mad=yes)
+-AC_ARG_ENABLE(ffmpeg,
+-[  --enable-ffmpeg         use ffmpeg for audio/video playback and film export [default=yes]], , enable_ffmpeg=yes)
+-AC_ARG_ENABLE(sndfile, 
+-[  --enable-sndfile        use libsndfile for decoding audio files [default=yes]], , enable_sndfile=yes)
+-AC_ARG_ENABLE(vorbis, 
+-[  --enable-vorbis         enable ogg/vorbis music playback [default=yes]], , enable_vorbis=yes)
+-AC_ARG_ENABLE(lua, 
+-[  --enable-lua            use built-in Lua scripting [default=yes]], , enable_lua=yes)
+-AC_ARG_ENABLE(smpeg, 
+-[  --enable-smpeg          use SMPEG for movie playback [default=yes]], , enable_smpeg=yes)
+-AC_ARG_ENABLE(speex, 
+-[  --enable-speex          enable Speex net mic playback [default=yes]], , enable_speex=yes)
+-AC_ARG_ENABLE(alsa,
+-[  --enable-alsa           enable ALSA net mic transmission [default=yes]], , enable_alsa=yes)
+-AC_ARG_ENABLE(zzip,
+-[  --enable-zzip           enable zziplib support [default=yes]], , enable_zzip=yes)
+-AC_ARG_ENABLE(png,
+-[  --enable-png            enable PNG screenshot support [default=yes]], , enable_png=yes)
+ 
+-dnl Checks for programs.
++dnl AX_ARG_ENABLE(option, desc)
++AC_DEFUN([AX_ARG_ENABLE],
++         [ desc_$1="$2"
++           AC_ARG_ENABLE([$1], AS_HELP_STRING([--disable-$1], [do not include $2])) ])
++dnl AX_ARG_WITH(option)
++AC_DEFUN([AX_ARG_WITH],
++         [ desc_$1="$2"
++           AC_ARG_WITH([$1], AS_HELP_STRING([--without-$1], [do not use $2])) ])
++
++AX_ARG_ENABLE([opengl], [OpenGL rendering])
++AX_ARG_ENABLE([lua], [built-in Lua scripting])
++
++AX_ARG_WITH([sdl_image], [SDL_image support])
++AX_ARG_WITH([ffmpeg], [FFmpeg playback and film export])
++AX_ARG_WITH([mad], [libmad MP3 playback])
++AX_ARG_WITH([sndfile], [libsndfile audio decoding])
++AX_ARG_WITH([vorbis], [libvorbis Ogg/Vorbis music playback])
++AX_ARG_WITH([smpeg], [SMPEG movie playback])
++AX_ARG_WITH([speex], [Speex net mic playback])
++AX_ARG_WITH([alsa], [ALSA net mic transmission])
++AX_ARG_WITH([zzip], [zziplib support])
++AX_ARG_WITH([png], [libpng PNG screenshot support])
++
++
++dnl Check for programs.
+ AC_PROG_CC
+ AC_PROG_CPP
+ AC_PROG_CXX
+ AC_PROG_CXXCPP
++AC_PROG_OBJCXX
+ AC_PROG_INSTALL
+ AC_PROG_RANLIB
+ 
+-dnl some platform specific stuff
+-case $target in
+-*-*-mingw32*)
+-	AC_CHECK_TOOL(WINDRES, windres, :)
+-	;;
+-*-*-netbsd*)
+-	CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"	
+-	;;
+-*)
+-	;;
+-esac
++dnl Some platform specific stuff.
++AS_CASE([$target],
++        [*-*-mingw32*],
++        [ make_windows=true
++          AC_CHECK_TOOL([WINDRES], [windres], [:])
++          AC_DEFINE([WIN32_DISABLE_MUSIC], [1], [Win32 music disabled])
++          LIBS="$LIBS -ldsound -lwsock32" ],
++        [*-*-netbsd*],
++        [CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"])
++AM_CONDITIONAL([MAKE_WINDOWS], [test "x$make_windows" = "xtrue"])
+ 
+-dnl Checks for headers.
+-AC_CHECK_HEADERS(unistd.h)
+-AC_CHECK_HEADERS(pwd.h)
++dnl Set target system name.
++AC_DEFINE_UNQUOTED([TARGET_PLATFORM], ["$target_os $target_cpu"], [Target platform name])
+ 
+-dnl Checks for library functions.
+-AC_CHECK_FUNC(snprintf, [
+-  AC_DEFINE(HAVE_SNPRINTF, 1, [snprintf() is available])
+-])
+-AC_CHECK_FUNC(vsnprintf, [
+-  AC_DEFINE(HAVE_VSNPRINTF, 1, [vsnprintf() is available])
+-])
++dnl Check for headers.
++AC_CHECK_HEADERS([unistd.h pwd.h])
+ 
+-AC_CHECK_FUNC(mkstemp, [
+-  AC_DEFINE(LUA_USE_MKSTEMP, 1, [mkstemp() is available])
+-])
+-AC_CHECK_FUNC(sysconf, [
+-  AC_DEFINE(HAVE_SYSCONF, 1, [sysconf() is available])
+-])
+-AC_CHECK_FUNC(sysctlbyname, [
+-  AC_DEFINE(HAVE_SYSCTLBYNAME, 1, [sysctlbyname() is available])
+-])
++dnl Check for boost functions.
++AC_LANG_PUSH(C++)
++AC_CHECK_HEADER([boost/bind.hpp],
++                ,
++                [AC_MSG_ERROR([You need boost/bind.hpp from the boost library to run Aleph One.])])
++AC_CHECK_HEADER([boost/function.hpp],
++                ,
++                [AC_MSG_ERROR([You need boost/function.hpp from the boost library to run Aleph One.])])
++AC_LANG_POP(C++)
+ 
+-dnl Check for SDL.
+-AM_PATH_SDL(1.2.0, , AC_MSG_ERROR([You need SDL 1.2 to run Aleph One.]))
+-CPPFLAGS="$CPPFLAGS $SDL_CFLAGS -DSDL"
+-LIBS="$LIBS $SDL_LIBS"
++dnl Check for library functions.
++AC_CHECK_FUNCS([snprintf vsnprintf sysconf sysctlbyname])
++AC_CHECK_FUNC([mkstemp],
++              [AC_DEFINE([LUA_USE_MKSTEMP], [1], [mkstemp() available])])
+ 
+-dnl Check for SDL_image.
+-AC_CHECK_HEADERS(SDL_image.h, [
+-  AC_CHECK_LIB(SDL_image, IMG_Load, [
+-    LIBS="-lSDL_image $LIBS"
+-    AC_DEFINE(HAVE_SDL_IMAGE, 1, [SDL_image support is enabled])
+-  ])
+-])
++dnl Check for net functions.
++AC_SEARCH_LIBS([gethostbyname], [nsl])
++AC_SEARCH_LIBS([socket], [socket],
++               ,
++               [AC_CHECK_LIB([nsl], [socket],
++                             [ LIBS="$LIBS -lsocket -lnsl" ],
++                             ,
++                             [-lsocket])])
+ 
+-AC_CHECK_HEADERS(SDL_ttf.h, [
+- AC_CHECK_LIB(SDL_ttf, TTF_Init, [
+-   LIBS="-lSDL_ttf $LIBS"
+-   AC_DEFINE(HAVE_SDL_TTF, 1, [SDL_TTF support is enabled])
+- ])],
+- AC_MSG_ERROR([You need SDL_ttf to run Aleph One.])
+-)
++dnl Check for libraries.
+ 
+-dnl Check for SDL_net.
+-AC_CHECK_HEADERS(SDL_net.h, [
+-  AC_CHECK_LIB(SDL_net, SDLNet_Init, [
+-    LIBS="-lSDL_net $LIBS"
+-    AC_DEFINE(HAVE_SDL_NET, 1, [SDL_net support is enabled])
+-  ])
+-])
+-if [[ "x$ac_cv_lib_SDL_net_SDLNet_Init" != xyes ]]; then
+-  AC_MSG_ERROR([You need SDL_net to run Aleph One.])
+-fi
+-AM_CONDITIONAL(HAVE_SDL_NET, test x$ac_cv_lib_SDL_net_SDLNet_Init = xyes)
++dnl AX_REQUIRE_LIB(desc, define, header, lib, func)
++AC_DEFUN([AX_REQUIRE_LIB],
++         [ AC_CHECK_HEADERS([$3], [AC_CHECK_LIB([$4], [$5])])
++           AS_IF([test "x${ac_cv_lib_$4_$5}" = "xyes"],
++                 [AC_DEFINE([HAVE_$2], [1], [$1 support enabled])],
++                 [AC_MSG_ERROR([You need $1 to run Aleph One.])]) ])
+ 
+-AC_SEARCH_LIBS(gethostbyname, nsl)
+-AC_SEARCH_LIBS(socket, socket, ,
+-    [AC_CHECK_LIB(nsl, socket, LIBS="$LIBS -lsocket -lnsl", , -lsocket)])
++dnl Check for required SDL dependencies.
++AM_PATH_SDL(1.2.0, , AC_MSG_ERROR([You need SDL 1.2 to run Aleph One.]))
++CPPFLAGS="$CPPFLAGS $SDL_CFLAGS -DSDL"
++LIBS="$LIBS $SDL_LIBS"
+ 
++AX_REQUIRE_LIB([SDL_ttf], [SDL_TTF],
++               [SDL_ttf.h], [SDL_ttf], [TTF_Init])
++AX_REQUIRE_LIB([SDL_net], [SDL_NET],
++               [SDL_net.h], [SDL_net], [SDLNet_Init])
+ 
+-dnl Check for zlib
+-AC_CHECK_HEADER(zlib.h, , AC_ERROR([Aleph One requires zlib]))
+-AC_CHECK_LIB(z, zlibVersion, LIBS="-lz $LIBS", AC_ERROR([Aleph One requires zlib]))
++dnl Check for zlib.
++AX_REQUIRE_LIB([zlib], [ZLIB],
++               [zlib.h], [z], [zlibVersion])
+ 
+-dnl Check for zziplib
+-have_zzip=false
+-if [[ "x$enable_zzip" = "xyes" ]]; then
+-PKG_CHECK_MODULES([ZZIP], [zziplib >= 0.10.75], [
+-			  CPPFLAGS="$ZZIP_CFLAGS $CPPFLAGS"
+-			  LIBS="$ZZIP_LIBS $LIBS"
+-			  have_zzip=true
+-			  AC_DEFINE(HAVE_ZZIP, 1, [ZZIP support enabled])
+-])
+-fi
+-AM_CONDITIONAL(BUILD_ZZIP_RWOPS, test x$have_zzip = xtrue)
++dnl Check for OpenGL.
++AS_IF([test "x$enable_opengl" != "xno"],
++      [ AC_MSG_CHECKING([for OpenGL support])
++        compiled_opengl=no
++        AS_CASE([$target],
++                [*-*-cygwin* | *-*-mingw32*],
++                [ SYS_GL_LIBS="-lGLEW -lopengl32 -lglu32"
++                  LIBS="$LIBS -lstdc++" ],
++                [*-*-darwin*],
++                [ SYS_GL_LIBS="-F/System/Library/Frameworks -framework AGL -framework OpenGL"
++                  CPPFLAGS="$CPPFLAGS -D__DARWIN__ -F/System/Library/Frameworks -I/System/Library/Frameworks/OpenGL.framework/Headers" ],
++                [*-*-linux*],
++                [ SYS_GL_LIBS="-lGL -lpthread" ],
++                [ SYS_GL_LIBS="-lGL" ])
++        AC_TRY_COMPILE([
++          #ifndef __DARWIN__
++          #include <GL/gl.h>
++          #else
++          #include <OpenGL/gl.h>
++          #endif
++          ],
++          ,
++          [ compiled_opengl=yes ])
++        AC_MSG_RESULT($compiled_opengl)
++        AS_IF([test "x$compiled_opengl" = "xyes"],
++              [ have_opengl=true
++                AC_DEFINE([HAVE_OPENGL], [1], [OpenGL support enabled])
++                AC_CHECK_LIB([GLU], [gluScaleImage],
++                             [SYS_GL_LIBS="$SYS_GL_LIBS -lGLU"],
++                             ,
++                             [$SYS_GL_LIBS])
++                LIBS="$LIBS $SYS_GL_LIBS"
++                AC_CHECK_HEADERS([GL/glext.h], [], [], [#include <GL/gl.h>]) ],
++              [ AS_IF([test "x$enable_opengl" = "xyes"],
++                      [AC_MSG_ERROR([OpenGL support requested but not available])],
++                      [AC_MSG_WARN([OpenGL not available])]) ]) ])
++AM_CONDITIONAL([MAKE_OPENGL], [test "x$have_opengl" = "xtrue" ])
+ 
+-have_png=false
+-if [[ "x$enable_png" = "xyes" ]]; then
+-PKG_CHECK_MODULES([PNG], [libpng], [
+-		  CPPFLAGS="$PNG_CFLAGS $CPPFLAGS"
+-		  LIBS="$PNG_LIBS $LIBS"
+-		  have_png=true
+-		  AC_DEFINE(HAVE_PNG, 1, [PNG support enabled])]
+-)
+-fi
+-AM_CONDITIONAL(HAVE_PNG, test x$have_png = xtrue)
++dnl Enable Lua.
++AS_IF([test "x$enable_lua" != "xno"],
++      [ have_lua=true
++        AC_DEFINE([HAVE_LUA], [1], [Lua support enabled]) ])
+ 
+-dnl Check for boost/bind
+-AC_LANG_PUSH(C++)
+-AC_CHECK_HEADER([boost/bind.hpp], , [AC_MSG_ERROR([You need boost/bind.hpp from the boost library to run Aleph One])])
+-AC_LANG_POP(C++)
+ 
+-dnl Check for boost/function
+-AC_LANG_PUSH(C++)
+-AC_CHECK_HEADER([boost/function.hpp], , [AC_MSG_ERROR([You need boost/function.hpp from the boost library to run Aleph One])])
+-AC_LANG_POP(C++)
++dnl Check optional packages.
+ 
+-if [[ "x$enable_smpeg" = "xyes" ]]; then
+-dnl Check for SMPEG
+-AC_CHECK_HEADERS([smpeg/smpeg.h], [
+-  AC_CHECK_LIB(smpeg, SMPEG_new, [
+-    LIBS="-lsmpeg $LIBS"
+-    AC_DEFINE(HAVE_SMPEG, 1, [SMPEG movie playback is enabled])
+-  ])
+-])
+-fi	    
++dnl AX_CHECK_FEATURE_LIB(option, define, header, lib, func)
++AC_DEFUN([AX_CHECK_FEATURE_LIB],
++         [ AS_IF([test "x${with_$1}" != "xno"],
++                 [ AC_CHECK_HEADERS([$3], [AC_CHECK_LIB([$4], [$5])])
++                   AS_IF([test "x${ac_cv_lib_$4_$5}" = "xyes"],
++                         [ have_$1=true
++                           AC_DEFINE([HAVE_$2], [1], [${desc_$1} enabled]) ],
++                         [AS_IF([test "x${with_$1}" = "xyes"],
++                                [AC_MSG_ERROR([${desc_$1} requested but not found])])])
++                 ]) ])
++dnl AX_CHECK_FEATURE_PKG(option, define, package, lib)
++AC_DEFUN([AX_CHECK_FEATURE_PKG],
++         [ AS_IF([test "x${with_$1}" != "xno"],
++                 [ PKG_CHECK_MODULES([$3], [$4],
++                                     [ CPPFLAGS="${[$3]_CFLAGS} $CPPFLAGS"
++                                       LIBS="${[$3]_LIBS} $LIBS"
++                                       have_$1=true
++                                       AC_DEFINE([HAVE_$2], [1], [${desc_$1} enabled]) ],
++                                     [AS_IF([test "x${with_$1}" = "xyes"],
++                                            [AC_MSG_ERROR([${desc_$1} requested but not available])])])
++           
++                 ])
++            AM_CONDITIONAL([HAVE_$2], [test "x${have_$1}" = "xtrue"])
++          ])
+ 
+-if [[ "x$enable_mad" = "xyes" ]]; then
+-dnl Check for libmad
+-AC_CHECK_HEADERS([mad.h], [
+-			  AC_CHECK_LIB(mad, mad_stream_init, [
+-			  LIBS="-lmad $LIBS"
+-			  AC_DEFINE(HAVE_MAD, 1, [MAD mp3 playback is enabled])
+-])
+-])
+-fi
++AX_CHECK_FEATURE_LIB([sdl_image], [SDL_IMAGE],
++                     [SDL_image.h], [SDL_image], [IMG_Load])
+ 
+-if [[ "x$enable_sndfile" = "xyes" ]]; then
+-dnl Check for libsndfile
+-AC_CHECK_HEADERS([sndfile.h], [
+-			      AC_CHECK_LIB(sndfile, sf_open, [
+-			      LIBS="-lsndfile $LIBS"
+-			      AC_DEFINE(HAVE_SNDFILE, 1, [libsndfile support is enabled])
+-])
+-])
+-fi
++AX_CHECK_FEATURE_PKG([ffmpeg], [FFMPEG],
++                     [FFMPEG], [libavcodec >= 53.61.100 libavformat >= 53.32.100 libavutil >= 51.35.100 libswscale >= 2.1.1])
+ 
+-if [[ "x$enable_vorbis" = "xyes" ]]; then
+-dnl Check for vorbisfile
+-PKG_CHECK_MODULES([VORBISFILE], [vorbisfile], [
+-			  CPPFLAGS="$VORBISFILE_CFLAGS $CPPFLAGS"
+-			  LIBS="$VORBISFILE_LIBS $LIBS"
+-			  AC_DEFINE(HAVE_VORBISFILE, 1, [vorbis support enabled])
+-])
+-fi
++AX_CHECK_FEATURE_LIB([mad], [MAD],
++                     [mad.h], [mad], [mad_stream_init])
+ 
+-if [[ "x$enable_ffmpeg" = "xyes" ]]; then
+-dnl Check for libavcodec
+-PKG_CHECK_MODULES([FFMPEG], [libavcodec >= 53.61.100 libavformat >= 53.32.100 libavutil >= 51.35.100 libswscale >= 2.1.100], [
+-			    CPPFLAGS="$FFMPEG_CFLAGS $CPPFLAGS"
+-			    LIBS="$FFMPEG_LIBS $LIBS"
+-			    AC_DEFINE(HAVE_FFMPEG, 1, [ffmpeg support enabled])
+-			    have_ffmpeg=true
+-])
+-fi
+-AM_CONDITIONAL(HAVE_FFMPEG, test x$have_ffmpeg = xtrue)
++AX_CHECK_FEATURE_LIB([sndfile], [SNDFILE],
++                     [sndfile.h], [sndfile], [sf_open])
+ 
+-if [[ "x$enable_lua" = "xyes" ]]; then
+-AC_DEFINE(HAVE_LUA, 1, [Lua support is enabled])
+-fi
++AX_CHECK_FEATURE_PKG([vorbis], [VORBISFILE],
++                     [VORBISFILE], [vorbisfile])
+ 
+-if [[ "x$enable_speex" = "xyes" ]]; then
+-dnl Check for Speex
+-AC_CHECK_HEADERS(speex/speex.h, [
+-  AC_CHECK_LIB(speex, speex_decoder_init, [
+-    LIBS="-lspeex $LIBS"
+-    AC_DEFINE(SPEEX, 1, [Speex support is enabled])
+-  ])
+-  AC_CHECK_LIB(speexdsp, speex_preprocess_state_init, [
+-  LIBS="-lspeexdsp $LIBS"
+-])
+-])
+-fi
++AX_CHECK_FEATURE_LIB([smpeg], [SMPEG],
++                     [smpeg/smpeg.h], [smpeg], [SMPEG_new])
+ 
+-if [[ "x$enable_alsa" = "xyes" ]]; then
+-dnl Check for ALSA
+-AC_CHECK_HEADERS([alsa/asoundlib.h], [
+-  AC_CHECK_LIB(asound, snd_pcm_open, [
+-    LIBS="-lasound $LIBS"
+-    AC_DEFINE(HAVE_ALSA, 1, [ALSA netmic is enabled])
+-  ])
+-])
+-fi
++AX_CHECK_FEATURE_LIB([speex], [SPEEX],
++                     [speex/speex.h], [speex], [speex_decoder_init])
++AS_IF([test "x$have_speex" = "xyes"],
++      [AC_CHECK_LIB([speexdsp], [speex_preprocess_state_init])])
+ 
+-dnl Figure out which OpenGL library to use
+-case "$target" in
+-  *-*-cygwin* | *-*-mingw32*)
+-    SYS_GL_LIBS="-lGLEW -lopengl32 -lglu32"
+-    LIBS="$LIBS -lstdc++"
+-    ;;
+-  *-*-darwin*)
+-    SYS_GL_LIBS="-F/System/Library/Frameworks -framework AGL -framework OpenGL"
+-    CPPFLAGS="$CPPFLAGS -D__DARWIN__ -F/System/Library/Frameworks  -I/System/Library/Frameworks/OpenGL.framework/Headers"
+-    ;;
+-  *-*-linux*)
+-    SYS_GL_LIBS="-lGL -lpthread"	
+-    ;;	
+-  *)
+-    SYS_GL_LIBS="-lGL"
+-    ;;
+-esac
++AX_CHECK_FEATURE_LIB([alsa], [ALSA],
++                     [alsa/asoundlib.h], [asound], [snd_pcm_open])
+ 
+-dnl Check for OpenGL.
+-if [[ "x$enable_opengl" = "xyes" ]]; then
+-  AC_MSG_CHECKING(for OpenGL support)
+-  have_opengl=no
+-  AC_TRY_COMPILE([
+-   #ifndef __DARWIN__
+-   #include <GL/gl.h>
+-   #else
+-   #include <OpenGL/gl.h>
+-   #endif
+-  ],[
+-  ],[
+-  have_opengl=yes
+-  ])
+-  AC_MSG_RESULT($have_opengl)
+-  if test x$have_opengl = xyes; then
+-    AC_DEFINE(HAVE_OPENGL, 1, [OpenGL support is enabled])
+-    AC_CHECK_LIB(GLU, gluScaleImage, [SYS_GL_LIBS="$SYS_GL_LIBS -lGLU"], , $SYS_GL_LIBS)
+-    LIBS="$LIBS $SYS_GL_LIBS"
+-    AC_CHECK_HEADERS(GL/glext.h, [], [], [#include <GL/gl.h>])
+-    make_opengl=true
+-  else
+-    AC_MSG_WARN([Could not find OpenGL, ignoring --enable-opengl.])
+-    make_opengl=false
+-  fi
+-fi
+-AM_CONDITIONAL(MAKE_OPENGL, test x$make_opengl = xtrue)
++AX_CHECK_FEATURE_PKG([zzip], [ZZIP],
++                     [ZZIP], [zziplib >= 0.10.75])
++AM_CONDITIONAL([BUILD_ZZIP_RWOPS], [test "x$have_zzip" = "xtrue"])
+ 
+-dnl Set target system name.
+-AC_DEFINE_UNQUOTED(TARGET_PLATFORM, "$target_os $target_cpu", [Target platform name])
++AX_CHECK_FEATURE_PKG([png], [PNG],
++                     [PNG], [libpng])
+ 
+-dnl add some windows goodies
+-case $target in
+-*-*-mingw32*)
+-	make_windows=true
+-	AC_DEFINE(WIN32_DISABLE_MUSIC, 1, [Win32 music is disabled])
+-	LIBS="$LIBS -ldsound -lwsock32"
+-	;;
+-*)
+-	make_windows=false ;;
+-esac
+-AM_CONDITIONAL(MAKE_WINDOWS, test x$make_windows = xtrue)
+ 
+-
+ dnl Generate Makefiles.
+ AC_CONFIG_FILES([
+ Makefile
+@@ -321,5 +249,32 @@
+ ])
+ AC_OUTPUT
+ 
+-dnl Print summary.
+-echo "Configuration done. Now type \"make\"."
++dnl Print summary of enabled/disabled options.
++
++dnl AX_PRINT_SUMMARY(option)
++AC_DEFUN([AX_PRINT_SUMMARY],
++         [ AS_IF([test "x${have_$1}" = "xtrue"],
++                 [AS_ECHO(["    Enabled: ${desc_$1}"])],
++                 [test "x${enable_$1}" = "xno" ||
++                  test "x${with_$1}" = "xno"],
++                 [AS_ECHO(["   Disabled: ${desc_$1}"])],
++                 [AS_ECHO(["  Not found: ${desc_$1}"])])
++         ])
++
++AS_ECHO([""])
++AS_ECHO(["Summary of optional features:"])
++AS_ECHO([""])
++AX_PRINT_SUMMARY([opengl])
++AX_PRINT_SUMMARY([lua])
++AX_PRINT_SUMMARY([sdl_image])
++AX_PRINT_SUMMARY([ffmpeg])
++AX_PRINT_SUMMARY([mad])
++AX_PRINT_SUMMARY([sndfile])
++AX_PRINT_SUMMARY([vorbis])
++AX_PRINT_SUMMARY([smpeg])
++AX_PRINT_SUMMARY([speex])
++AX_PRINT_SUMMARY([alsa])
++AX_PRINT_SUMMARY([zzip])
++AX_PRINT_SUMMARY([png])
++AS_ECHO([""])
++AS_ECHO(["Configuration done. Now type \"make\"."])
diff --git a/games/alephone/r5037.diff b/games/alephone/r5037.diff
new file mode 100644
index 0000000..852d752
--- /dev/null
+++ b/games/alephone/r5037.diff
@@ -0,0 +1,193 @@
+Index: Source_Files/FFmpeg/Movie.cpp
+===================================================================
+--- Source_Files/FFmpeg/Movie.cpp	(revision 5036)
++++ Source_Files/FFmpeg/Movie.cpp	(revision 5037)
+@@ -138,6 +138,9 @@
+     AVFormatContext *fmt_ctx;
+     int video_stream_idx;
+     int audio_stream_idx;
++    
++    size_t video_counter;
++    size_t audio_counter;
+ };
+ typedef struct libav_vars libav_vars_t;
+ 
+@@ -495,6 +498,7 @@
+         audio_stream->codec->codec_id = audio_codec->id;
+         audio_stream->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+         audio_stream->codec->sample_rate = mx->obtained.freq;
++        audio_stream->codec->time_base = (AVRational){1, mx->obtained.freq};
+         audio_stream->codec->channels = 2;
+         
+         if (av->fmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
+@@ -507,19 +511,8 @@
+         audio_stream->codec->global_quality = FF_QP2LAMBDA * (aq / 10);
+         audio_stream->codec->flags |= CODEC_FLAG_QSCALE;
+         
+-        // find correct sample format
+-        audio_stream->codec->sample_fmt = AV_SAMPLE_FMT_S16;
++        audio_stream->codec->sample_fmt = AV_SAMPLE_FMT_FLTP;
+         success = (0 <= avcodec_open2(audio_stream->codec, audio_codec, NULL));
+-        if (!success)
+-        {
+-            audio_stream->codec->sample_fmt = AV_SAMPLE_FMT_FLT;
+-            success = (0 <= avcodec_open2(audio_stream->codec, audio_codec, NULL));
+-        }
+-        if (!success)
+-        {
+-            audio_stream->codec->sample_fmt = AV_SAMPLE_FMT_FLTP;
+-            success = (0 <= avcodec_open2(audio_stream->codec, audio_codec, NULL));
+-        }
+         if (!success) err_msg = "Could not open audio codec";
+     }
+     if (success)
+@@ -568,6 +561,7 @@
+     if (success)
+     {
+         video_stream->time_base = (AVRational){1, TICKS_PER_SECOND};
++        audio_stream->time_base = (AVRational){1, mx->obtained.freq};
+         avformat_write_header(av->fmt_ctx, NULL);
+     }
+     
+@@ -625,7 +619,7 @@
+     
+         sws_scale(av->sws_ctx, pdata, pitch, 0, temp_surface->h,
+                   av->video_frame->data, av->video_frame->linesize);
+-        av->video_frame->pts = vcodec->frame_number;
++        av->video_frame->pts = av->video_counter++;
+         frame = av->video_frame;
+     }
+     
+@@ -638,33 +632,22 @@
+         pkt.data = av->video_buf;
+         pkt.size = av->video_bufsize;
+         
+-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54,0,0)
+-        int vsize = avcodec_encode_video(vcodec, av->video_buf, av->video_bufsize, frame);
+-        if (vsize > 0)
+-        {
+-            if (vcodec->coded_frame->pts != AV_NOPTS_VALUE)
+-            {
+-                pkt.pts = av_rescale_q(vcodec->coded_frame->pts,
+-                                       vcodec->time_base,
+-                                       vstream->time_base);
+-            }
+-            if (vcodec->coded_frame->key_frame)
+-                pkt.flags |= AV_PKT_FLAG_KEY;
+-            pkt.size = vsize;
+-        }
+-
+-#else
+         int got_packet = 0;
+         int vsize = avcodec_encode_video2(vcodec, &pkt, frame, &got_packet);
+-#endif
+-        if (vsize > 0)
++        if (vsize == 0 && got_packet)
+         {
++            if (pkt.pts != AV_NOPTS_VALUE && pkt.pts < pkt.dts)
++                pkt.pts = pkt.dts;
++            if (pkt.pts != AV_NOPTS_VALUE)
++                pkt.pts = av_rescale_q(pkt.pts, vcodec->time_base, vstream->time_base);
++            if (pkt.dts != AV_NOPTS_VALUE)
++                pkt.dts = av_rescale_q(pkt.dts, vcodec->time_base, vstream->time_base);
++            pkt.duration = av_rescale_q(pkt.duration, vcodec->time_base, vstream->time_base);
+             pkt.stream_index = vstream->index;
+             av_interleaved_write_frame(av->fmt_ctx, &pkt);
++            av_free_packet(&pkt);
+         }
+-        av_free_packet(&pkt);
+-        
+-        if (!last || vsize <= 0)
++        if (!last || vsize < 0 || !got_packet)
+             done = true;
+     }
+ }
+@@ -712,6 +695,10 @@
+         av_frame_unref(av->audio_frame);
+ #endif
+         av->audio_frame->nb_samples = write_samples;
++        av->audio_frame->pts = av_rescale_q(av->audio_counter,
++                                            (AVRational){1, acodec->sample_rate},
++                                            acodec->time_base);
++        av->audio_counter += write_samples;
+         int asize = avcodec_fill_audio_frame(av->audio_frame, acodec->channels,
+                                              acodec->sample_fmt,
+                                              av->audio_data_conv,
+@@ -726,24 +713,57 @@
+             if (0 == avcodec_encode_audio2(acodec, &pkt, av->audio_frame, &got_pkt)
+                 && got_pkt)
+             {
+-                if (acodec->coded_frame && acodec->coded_frame->pts != AV_NOPTS_VALUE)
+-                {
+-                    pkt.pts = av_rescale_q(acodec->coded_frame->pts,
+-                                           acodec->time_base,
+-                                           astream->time_base);
+-                }
++                if (pkt.pts != AV_NOPTS_VALUE && pkt.pts < pkt.dts)
++                    pkt.pts = pkt.dts;
++                if (pkt.pts != AV_NOPTS_VALUE)
++                    pkt.pts = av_rescale_q(pkt.pts, acodec->time_base, astream->time_base);
++                if (pkt.dts != AV_NOPTS_VALUE)
++                    pkt.dts = av_rescale_q(pkt.dts, acodec->time_base, astream->time_base);
++                pkt.duration = av_rescale_q(pkt.duration, acodec->time_base, astream->time_base);
+                 pkt.stream_index = astream->index;
+-                pkt.flags |= AV_PKT_FLAG_KEY;
+                 av_interleaved_write_frame(av->fmt_ctx, &pkt);
+                 av_free_packet(&pkt);
+             }
+         }
+     }
++    if (last)
++    {
++        bool done = false;
++        while (!done)
++        {
++            AVPacket pkt;
++            memset(&pkt, 0, sizeof(AVPacket));
++            av_init_packet(&pkt);
++            
++            int got_pkt = 0;
++            if (0 == avcodec_encode_audio2(acodec, &pkt, NULL, &got_pkt)
++                && got_pkt)
++            {
++                if (pkt.pts != AV_NOPTS_VALUE && pkt.pts < pkt.dts)
++                    pkt.pts = pkt.dts;
++                if (pkt.pts != AV_NOPTS_VALUE)
++                    pkt.pts = av_rescale_q(pkt.pts, acodec->time_base, astream->time_base);
++                if (pkt.dts != AV_NOPTS_VALUE)
++                    pkt.dts = av_rescale_q(pkt.dts, acodec->time_base, astream->time_base);
++                pkt.duration = av_rescale_q(pkt.duration, acodec->time_base, astream->time_base);
++                pkt.stream_index = astream->index;
++                av_interleaved_write_frame(av->fmt_ctx, &pkt);
++                av_free_packet(&pkt);
++            }
++            else
++            {
++                done = true;
++            }
++        }
++        
++    }
+     
+ }
+ 
+ void Movie::EncodeThread()
+ {
++	av->video_counter = 0;
++	av->audio_counter = 0;
+ 	while (true)
+ 	{
+ 		SDL_SemWait(encodeReady);
+Index: configure.ac
+===================================================================
+--- configure.ac	(revision 5036)
++++ configure.ac	(revision 5037)
+@@ -191,7 +191,7 @@
+                      [SDL_image.h], [SDL_image], [IMG_Load])
+ 
+ AX_CHECK_FEATURE_PKG([ffmpeg], [FFMPEG],
+-                     [FFMPEG], [libavcodec >= 53.61.100 libavformat >= 53.32.100 libavutil >= 51.35.100 libswscale >= 2.1.1])
++                     [FFMPEG], [libavcodec >= 54.35.0 libavformat >= 54.20.0 libavutil >= 52.3.0 libswscale >= 2.1.1])
+ 
+ AX_CHECK_FEATURE_LIB([mad], [MAD],
+                      [mad.h], [mad], [mad_stream_init])
-- 
2.3.5

From fa5bf570f410d906d9794e0e3a952862401b405b Mon Sep 17 00:00:00 2001
From: David Spencer <baildon.resea...@googlemail.com>
Date: Wed, 27 May 2015 11:10:36 +0100
Subject: [PATCH 07/15] audio/audacity: Patched for ffmpeg-2.6.3.

Signed-off-by: David Spencer <baildon.resea...@googlemail.com>
---
 audio/audacity/audacity-2.0.6_ffmpeg-2.6.3.patch | 30 ++++++++++++++++++++++++
 audio/audacity/audacity.SlackBuild               |  3 +++
 2 files changed, 33 insertions(+)
 create mode 100644 audio/audacity/audacity-2.0.6_ffmpeg-2.6.3.patch

diff --git a/audio/audacity/audacity-2.0.6_ffmpeg-2.6.3.patch b/audio/audacity/audacity-2.0.6_ffmpeg-2.6.3.patch
new file mode 100644
index 0000000..d0b9935
--- /dev/null
+++ b/audio/audacity/audacity-2.0.6_ffmpeg-2.6.3.patch
@@ -0,0 +1,30 @@
+diff -Naur audacity-src-2.0.6-orig/src/FFmpeg.h audacity-src-2.0.6/src/FFmpeg.h
+--- audacity-src-2.0.6-orig/src/FFmpeg.h	2014-09-28 21:54:55.159636208 -0400
++++ audacity-src-2.0.6/src/FFmpeg.h	2014-09-28 21:55:11.246276766 -0400
+@@ -688,7 +688,7 @@
+    FFMPEG_FUNCTION_WITH_RETURN(
+       AVOutputFormat*,
+       av_oformat_next,
+-      (AVOutputFormat *f),
++      (const AVOutputFormat *f),
+       (f)
+    );
+    FFMPEG_FUNCTION_WITH_RETURN(
+@@ -755,7 +755,7 @@
+    FFMPEG_FUNCTION_WITH_RETURN(
+       int,
+       av_fifo_size,
+-      (AVFifoBuffer *f),
++      (const AVFifoBuffer *f),
+       (f)
+    );
+    FFMPEG_FUNCTION_WITH_RETURN(
+@@ -801,7 +801,7 @@
+    FFMPEG_FUNCTION_WITH_RETURN(
+       AVDictionaryEntry *,
+       av_dict_get,
+-      (AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags),
++      (const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags),
+       (m, key, prev, flags)
+    );
+    FFMPEG_FUNCTION_WITH_RETURN(
diff --git a/audio/audacity/audacity.SlackBuild b/audio/audacity/audacity.SlackBuild
index 4a83847..f0ea022 100644
--- a/audio/audacity/audacity.SlackBuild
+++ b/audio/audacity/audacity.SlackBuild
@@ -87,6 +87,9 @@ find -L . \
 sed -i "s,lib/vamp,lib$LIBDIRSUFFIX/vamp,g" \
   lib-src/libvamp/src/vamp-hostsdk/PluginHostAdapter.cpp || true
 
+# patch for ffmpeg-2.6.3 -- thanks to Arch Linux and John Vogel
+patch -p1 <$CWD/audacity-2.0.6_ffmpeg-2.6.3.patch
+
 # libsoxr is the new default resampling library
 CFLAGS="$SLKCFLAGS" \
 CXXFLAGS="$SLKCFLAGS" \
-- 
2.3.5

From af17dc61a9949716f13e58f0a70ccbbcbef76253 Mon Sep 17 00:00:00 2001
From: David Spencer <baildon.resea...@googlemail.com>
Date: Wed, 27 May 2015 11:14:15 +0100
Subject: [PATCH 08/15] multimedia/bombono-dvd: Patched for ffmpeg-2.6.3.

Signed-off-by: David Spencer <baildon.resea...@googlemail.com>
---
 multimedia/bombono-dvd/bombono-dvd.SlackBuild               |  2 ++
 .../bombono-dvd/patches/bombono-dvd-1.2.2-ffmpeg26.patch    | 13 +++++++++++++
 2 files changed, 15 insertions(+)
 create mode 100644 multimedia/bombono-dvd/patches/bombono-dvd-1.2.2-ffmpeg26.patch

diff --git a/multimedia/bombono-dvd/bombono-dvd.SlackBuild b/multimedia/bombono-dvd/bombono-dvd.SlackBuild
index a853442..c6529f4 100644
--- a/multimedia/bombono-dvd/bombono-dvd.SlackBuild
+++ b/multimedia/bombono-dvd/bombono-dvd.SlackBuild
@@ -77,6 +77,8 @@ sed -i "s|-O2||" SConstruct
 patch -p1 < $CWD/patches/bombono-dvd-1.2.0-cdrtools.patch
 # Fix for the newer ffmpeg - thanks ArchLinux
 patch -p1 < $CWD/patches/fix_ffmpeg_codecid.patch
+# Fix for ffmpeg-2.6.3 - thanks to Gentoo and John Vogel
+patch -p1 < $CWD/patches/bombono-dvd-1.2.2-ffmpeg26.patch
 
 # Build package
 
diff --git a/multimedia/bombono-dvd/patches/bombono-dvd-1.2.2-ffmpeg26.patch b/multimedia/bombono-dvd/patches/bombono-dvd-1.2.2-ffmpeg26.patch
new file mode 100644
index 0000000..b511a9d
--- /dev/null
+++ b/multimedia/bombono-dvd/patches/bombono-dvd-1.2.2-ffmpeg26.patch
@@ -0,0 +1,13 @@
+Index: bombono-dvd-1.2.2/src/mgui/ffviewer.cpp
+===================================================================
+--- bombono-dvd-1.2.2.orig/src/mgui/ffviewer.cpp
++++ bombono-dvd-1.2.2/src/mgui/ffviewer.cpp
+@@ -1120,7 +1120,7 @@ static bool SeekSetTime(FFViewer& ffv, d
+         bool seek_ok = TimeSeek(ffv, start_time, time);
+         if( !seek_ok && CanByteSeek(ffv.iCtx) )
+             // тогда переходим в начало файла
+-            seek_ok = DoSeek(ffv, ffv.iCtx->data_offset, true);
++            seek_ok = DoSeek(ffv, 0, true);
+ 
+         // некоторое видео глючит в начале (Hellboy), из-за чего
+         // последовательный доступ выполняется с перескоками -
-- 
2.3.5

From 2ff8e7c51e8b2cfa14ffeee6ddb96e0ebf5567c1 Mon Sep 17 00:00:00 2001
From: David Spencer <baildon.resea...@googlemail.com>
Date: Wed, 27 May 2015 11:22:09 +0100
Subject: [PATCH 09/15] audio/mpd: Updated for version 0.19.9.

This fixes building with ffmpeg-2.6.3. Thanks to John Vogel.

Signed-off-by: David Spencer <baildon.resea...@googlemail.com>
---
 audio/mpd/mpd.SlackBuild | 2 +-
 audio/mpd/mpd.info       | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/audio/mpd/mpd.SlackBuild b/audio/mpd/mpd.SlackBuild
index b28788c..5b0b785 100644
--- a/audio/mpd/mpd.SlackBuild
+++ b/audio/mpd/mpd.SlackBuild
@@ -24,7 +24,7 @@
 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 PRGNAM=mpd
-VERSION=${VERSION:-0.19}
+VERSION=${VERSION:-0.19.9}
 BUILD=${BUILD:-1}
 TAG=${TAG:-_SBo}
 
diff --git a/audio/mpd/mpd.info b/audio/mpd/mpd.info
index ad8b5c9..dc87737 100644
--- a/audio/mpd/mpd.info
+++ b/audio/mpd/mpd.info
@@ -1,8 +1,8 @@
 PRGNAM="mpd"
-VERSION="0.19"
+VERSION="0.19.9"
 HOMEPAGE="http://www.musicpd.org/";
-DOWNLOAD="http://www.musicpd.org/download/mpd/0.19/mpd-0.19.tar.xz";
-MD5SUM="770261630e6f086bd7d5b374abf521c0"
+DOWNLOAD="http://www.musicpd.org/download/mpd/0.19/mpd-0.19.9.tar.xz";
+MD5SUM="1a66f7b4db1fa61b87e04e666c94088d"
 DOWNLOAD_x86_64=""
 MD5SUM_x86_64=""
 REQUIRES=""
-- 
2.3.5

From b511b522583c5684a8751601efed1c5e7b913076 Mon Sep 17 00:00:00 2001
From: David Spencer <baildon.resea...@googlemail.com>
Date: Wed, 27 May 2015 11:37:51 +0100
Subject: [PATCH 12/15] desktop/ffmpegthumbnailer: Fix .info.

Signed-off-by: David Spencer <baildon.resea...@googlemail.com>
---
 desktop/ffmpegthumbnailer/ffmpegthumbnailer.info | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/desktop/ffmpegthumbnailer/ffmpegthumbnailer.info b/desktop/ffmpegthumbnailer/ffmpegthumbnailer.info
index 28d4111..bdf6559 100644
--- a/desktop/ffmpegthumbnailer/ffmpegthumbnailer.info
+++ b/desktop/ffmpegthumbnailer/ffmpegthumbnailer.info
@@ -1,5 +1,5 @@
 PRGNAM="ffmpegthumbnailer"
-VERSION="2.0.9"
+VERSION="2.0.10"
 HOMEPAGE="https://github.com/dirkvdb/ffmpegthumbnailer";
 DOWNLOAD="https://github.com/dirkvdb/ffmpegthumbnailer/releases/download/2.0.10/ffmpegthumbnailer-2.0.10.tar.bz2";
 MD5SUM="3918d43b9d76c6e3eaf17e1c0c7dd5bc"
-- 
2.3.5

From 0846ec3f845af9af7f00881ddb1b98d20bfbfbf1 Mon Sep 17 00:00:00 2001
From: David Spencer <baildon.resea...@googlemail.com>
Date: Wed, 27 May 2015 23:39:08 +0100
Subject: [PATCH 13/15] games/dolphin-emu: Removed patch.

Signed-off-by: David Spencer <baildon.resea...@googlemail.com>
---
 games/dolphin-emu/dolphin-emu-4.0-gtk3.patch | 33 ----------------------------
 games/dolphin-emu/dolphin-emu.SlackBuild     |  2 --
 2 files changed, 35 deletions(-)
 delete mode 100644 games/dolphin-emu/dolphin-emu-4.0-gtk3.patch

diff --git a/games/dolphin-emu/dolphin-emu-4.0-gtk3.patch b/games/dolphin-emu/dolphin-emu-4.0-gtk3.patch
deleted file mode 100644
index 9f0b3aa..0000000
--- a/games/dolphin-emu/dolphin-emu-4.0-gtk3.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-diff -rupN dolphin-emu-2879cbd2b564-orig/CMakeLists.txt dolphin-emu-2879cbd2b564/CMakeLists.txt
---- dolphin-emu-2879cbd2b564-orig/CMakeLists.txt	2014-03-07 20:10:55.185158971 -0500
-+++ dolphin-emu-2879cbd2b564/CMakeLists.txt	2014-03-07 20:16:00.388691555 -0500
-@@ -707,13 +707,11 @@ if(NOT DISABLE_WX AND NOT ANDROID)
- 			OUTPUT_VARIABLE DIST_NAME
- 			ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
- 		if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}
--				VERSION_EQUAL 2.8.2 OR "${DIST_NAME}" STREQUAL "natty")
--			check_lib(GTK2 gtk+-2.0 gtk.h REQUIRED)
-+				VERSION_EQUAL 2.8.12 OR "${DIST_NAME}" STREQUAL "natty")
-+			check_lib(GTK3 gtk+-3.0 gtk.h REQUIRED)
- 		else()
--			include(FindGTK2)
--			if(GTK2_FOUND)
--				include_directories(${GTK2_INCLUDE_DIRS})
--			endif()
-+			include(FindGTK)
-+			include_directories(${GTK3_INCLUDE_DIRS})
- 		endif()
- 	endif()
- 
-diff -rupN dolphin-emu-2879cbd2b564-orig/Source/Core/DolphinWX/CMakeLists.txt dolphin-emu-2879cbd2b564/Source/Core/DolphinWX/CMakeLists.txt
---- dolphin-emu-2879cbd2b564-orig/Source/Core/DolphinWX/CMakeLists.txt	2014-03-07 20:10:55.186158963 -0500
-+++ dolphin-emu-2879cbd2b564/Source/Core/DolphinWX/CMakeLists.txt	2014-03-07 20:18:55.977272101 -0500
-@@ -11,7 +11,7 @@ set(LIBS	core
- 			audiocommon
- 			z
- 			sfml-network
--			${GTK2_LIBRARIES})
-+			${GTK3_LIBRARIES})
- 
- if(NOT ANDROID)
- 	if(USE_X11)
diff --git a/games/dolphin-emu/dolphin-emu.SlackBuild b/games/dolphin-emu/dolphin-emu.SlackBuild
index c5c4f0c..bb0481b 100644
--- a/games/dolphin-emu/dolphin-emu.SlackBuild
+++ b/games/dolphin-emu/dolphin-emu.SlackBuild
@@ -69,8 +69,6 @@ find -L . \
  \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
   -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
 
-patch -p1 < $CWD/dolphin-emu-4.0-gtk3.patch
-
 mkdir build
 cd build
   cmake -G "Unix Makefiles" \
-- 
2.3.5

_______________________________________________
SlackBuilds-users mailing list
SlackBuilds-users@slackbuilds.org
http://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - http://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - http://slackbuilds.org/faq/

Reply via email to