diff options
author | Joakim Plate <elupus@ecce.se> | 2013-06-13 12:09:27 -0700 |
---|---|---|
committer | Joakim Plate <elupus@ecce.se> | 2013-06-13 12:09:27 -0700 |
commit | 269b609e2a7c9ec20d898f86eea35a71297630bc (patch) | |
tree | b5df74a0800dd4b9eec276ae5f89cbd4d8d91980 | |
parent | a0a6e8e244fe9dfd06c6b1bf074b21f0e27e80f5 (diff) | |
parent | 451f9ce57d249a1d69d73ccc5997259a035fc25c (diff) |
Merge pull request #2873 from aballier/resampler_fix
[Fix] DVDAudioCodecFFmpeg: do not reopen the resample context for each frame.
-rw-r--r-- | xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp index 9be5de4ac1..bee341a4ab 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp @@ -202,14 +202,14 @@ void CDVDAudioCodecFFmpeg::ConvertToFloat() m_dllAvUtil.av_get_default_channel_layout(m_pCodecContext->channels), AV_SAMPLE_FMT_FLT, m_pCodecContext->sample_rate, m_dllAvUtil.av_get_default_channel_layout(m_pCodecContext->channels), m_pCodecContext->sample_fmt, m_pCodecContext->sample_rate, 0, NULL); - } - if(!m_pConvert || m_dllSwResample.swr_init(m_pConvert) < 0) - { - CLog::Log(LOGERROR, "CDVDAudioCodecFFmpeg::Decode - Unable to convert %d to AV_SAMPLE_FMT_FLT", m_pCodecContext->sample_fmt); - m_iBufferSize1 = 0; - m_iBufferSize2 = 0; - return; + if(!m_pConvert || m_dllSwResample.swr_init(m_pConvert) < 0) + { + CLog::Log(LOGERROR, "CDVDAudioCodecFFmpeg::Decode - Unable to convert %d to AV_SAMPLE_FMT_FLT", m_pCodecContext->sample_fmt); + m_iBufferSize1 = 0; + m_iBufferSize2 = 0; + return; + } } int len = m_iBufferSize1 / m_dllAvUtil.av_get_bytes_per_sample(m_pCodecContext->sample_fmt); |