Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2873 from aballier/resampler_fix

[Fix] DVDAudioCodecFFmpeg: do not reopen the resample context for each frame.
  • Loading branch information...
commit 269b609e2a7c9ec20d898f86eea35a71297630bc 2 parents a0a6e8e + 451f9ce
Joakim Plate elupus authored
Showing with 7 additions and 7 deletions.
  1. +7 −7 xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp
14 xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp
View
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.