From 7b2739f21a7ed0d52497fa381c9a2383e71ab7a8 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 10 Jun 2012 00:04:00 +0000 Subject: Sun Jun 10 00:04:00 UTC 2012 --- community-staging/performous/ffmpeg-0.11.patch | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 community-staging/performous/ffmpeg-0.11.patch (limited to 'community-staging/performous/ffmpeg-0.11.patch') diff --git a/community-staging/performous/ffmpeg-0.11.patch b/community-staging/performous/ffmpeg-0.11.patch new file mode 100644 index 000000000..2962123ed --- /dev/null +++ b/community-staging/performous/ffmpeg-0.11.patch @@ -0,0 +1,42 @@ +diff -ru Performous-0.6.1-Source/game/ffmpeg.cc Performous-0.6.1a-Source/game/ffmpeg.cc +--- Performous-0.6.1-Source/game/ffmpeg.cc 2010-10-31 16:05:43.000000000 +0000 ++++ Performous-0.6.1a-Source/game/ffmpeg.cc 2012-06-08 21:40:10.876636789 +0000 +@@ -47,11 +47,17 @@ + return d >= 0.0 ? d : getInf(); + } + ++// FFMPEG has fluctuating API ++#if LIBAVCODEC_VERSION_INT < ((52<<16)+(64<<8)+0) ++#define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO ++#define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO ++#endif ++ + void FFmpeg::open() { + boost::mutex::scoped_lock l(s_avcodec_mutex); + av_register_all(); + av_log_set_level(AV_LOG_ERROR); +- if (av_open_input_file(&pFormatCtx, m_filename.c_str(), NULL, 0, NULL)) throw std::runtime_error("Cannot open input file"); ++ if (avformat_open_input(&pFormatCtx, m_filename.c_str(), NULL, NULL)) throw std::runtime_error("Cannot open input file"); + if (av_find_stream_info(pFormatCtx) < 0) throw std::runtime_error("Cannot find stream information"); + pFormatCtx->flags |= AVFMT_FLAG_GENPTS; + videoStream = -1; +@@ -60,8 +66,8 @@ + for (unsigned int i=0; inb_streams; i++) { + AVCodecContext* cc = pFormatCtx->streams[i]->codec; + cc->workaround_bugs = FF_BUG_AUTODETECT; +- if (videoStream == -1 && cc->codec_type==CODEC_TYPE_VIDEO) videoStream = i; +- if (audioStream == -1 && cc->codec_type==CODEC_TYPE_AUDIO) audioStream = i; ++ if (videoStream == -1 && cc->codec_type==AVMEDIA_TYPE_VIDEO) videoStream = i; ++ if (audioStream == -1 && cc->codec_type==AVMEDIA_TYPE_AUDIO) audioStream = i; + } + if (videoStream == -1 && decodeVideo) throw std::runtime_error("No video stream found"); + if (audioStream == -1 && decodeAudio) throw std::runtime_error("No audio stream found"); +@@ -92,7 +98,7 @@ + pAudioCodecCtx = cc; + #if LIBAVCODEC_VERSION_INT > ((52<<16)+(12<<8)+0) + pResampleCtx = av_audio_resample_init(AUDIO_CHANNELS, cc->channels, m_rate, cc->sample_rate, +- SAMPLE_FMT_S16, SAMPLE_FMT_S16, 16, 10, 0, 0.8); ++ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16, 16, 10, 0, 0.8); + #else + pResampleCtx = audio_resample_init(AUDIO_CHANNELS, cc->channels, m_rate, cc->sample_rate); + #endif -- cgit v1.2.3-54-g00ecf