From d7e427beffb6589ada91c4336e6ee86459cb24d8 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 28 Feb 2013 18:28:08 +0000 Subject: Fix/workaround for newer FFmpeg 1.1.3 and MP3 decoder FFmpeg is now using S16P sampler for MP3 which is not actually supported by audaspace, so request for S16 sampler instead. --- intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp | 5 +++++ intern/ffmpeg/ffmpeg_compat.h | 1 + 2 files changed, 6 insertions(+) diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp index 831e1998182..47bfe4e69b9 100644 --- a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp +++ b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp @@ -133,6 +133,11 @@ void AUD_FFMPEGReader::init() if(!aCodec) AUD_THROW(AUD_ERROR_FFMPEG, nodecoder_error); +#ifdef FFMPEG_SAMPLE_FMT_S16P_SUPPORTED + if(m_codecCtx->sample_fmt == AV_SAMPLE_FMT_S16P) + m_codecCtx->request_sample_fmt = AV_SAMPLE_FMT_S16; +#endif + if(avcodec_open2(m_codecCtx, aCodec, NULL) < 0) AUD_THROW(AUD_ERROR_FFMPEG, codecopen_error); diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h index c07dc869291..8663c96a22e 100644 --- a/intern/ffmpeg/ffmpeg_compat.h +++ b/intern/ffmpeg/ffmpeg_compat.h @@ -74,6 +74,7 @@ #if ((LIBAVUTIL_VERSION_MAJOR > 51) || (LIBAVUTIL_VERSION_MAJOR == 51) && (LIBAVUTIL_VERSION_MINOR >= 32)) #define FFMPEG_FFV1_ALPHA_SUPPORTED +#define FFMPEG_SAMPLE_FMT_S16P_SUPPORTED #endif #if ((LIBAVUTIL_VERSION_MAJOR < 51) || (LIBAVUTIL_VERSION_MAJOR == 51) && (LIBAVUTIL_VERSION_MINOR < 22)) -- cgit v1.2.3