diff options
author | popcornmix <popcornmix@gmail.com> | 2013-06-14 19:38:20 +0100 |
---|---|---|
committer | popcornmix <popcornmix@gmail.com> | 2013-06-14 19:39:27 +0100 |
commit | 586318769fb03eb4064f662ee8f9528470de894d (patch) | |
tree | f3e59d8ae0f9a6d724ec484ef578ed638cc11e6f | |
parent | a2e9a819a4fcc9ec47ec097524d335ec022e3ca1 (diff) |
[rbp/omxplayer] do not reopen the resample context for each frame.
I think this doesn't tend to happen on Pi now, as AV_SAMPLE_FMT_S16 and AV_SAMPLE_FMT_FLTP bypass the resampler,
but best to fix it if some obscure codec returns something else.
See #2873
-rw-r--r-- | xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp index 2d8fa7a141..1b8ac24a4a 100644 --- a/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp +++ b/xbmc/cores/omxplayer/OMXAudioCodecOMX.cpp @@ -200,14 +200,14 @@ int COMXAudioCodecOMX::Decode(BYTE* pData, int iSize) 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, "COMXAudioCodecOMX::Decode - Unable to initialise convert format %d to %d", m_pCodecContext->sample_fmt, m_desiredSampleFormat); - m_iBufferSize1 = 0; - m_iBufferSize2 = 0; - return iBytesUsed; + if(!m_pConvert || m_dllSwResample.swr_init(m_pConvert) < 0) + { + CLog::Log(LOGERROR, "COMXAudioCodecOMX::Decode - Unable to initialise convert format %d to %d", m_pCodecContext->sample_fmt, m_desiredSampleFormat); + m_iBufferSize1 = 0; + m_iBufferSize2 = 0; + return iBytesUsed; + } } m_iBufferSize1 = 0; |