Skip to content
This repository
Browse code

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 authored June 13, 2013
14  xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp
@@ -202,14 +202,14 @@ void CDVDAudioCodecFFmpeg::ConvertToFloat()
202 202
                       m_dllAvUtil.av_get_default_channel_layout(m_pCodecContext->channels), AV_SAMPLE_FMT_FLT, m_pCodecContext->sample_rate,
203 203
                       m_dllAvUtil.av_get_default_channel_layout(m_pCodecContext->channels), m_pCodecContext->sample_fmt, m_pCodecContext->sample_rate,
204 204
                       0, NULL);
205  
-    }
206 205
 
207  
-    if(!m_pConvert || m_dllSwResample.swr_init(m_pConvert) < 0)
208  
-    {
209  
-      CLog::Log(LOGERROR, "CDVDAudioCodecFFmpeg::Decode - Unable to convert %d to AV_SAMPLE_FMT_FLT", m_pCodecContext->sample_fmt);
210  
-      m_iBufferSize1 = 0;
211  
-      m_iBufferSize2 = 0;
212  
-      return;
  206
+      if(!m_pConvert || m_dllSwResample.swr_init(m_pConvert) < 0)
  207
+      {
  208
+          CLog::Log(LOGERROR, "CDVDAudioCodecFFmpeg::Decode - Unable to convert %d to AV_SAMPLE_FMT_FLT", m_pCodecContext->sample_fmt);
  209
+          m_iBufferSize1 = 0;
  210
+          m_iBufferSize2 = 0;
  211
+          return;
  212
+      }
213 213
     }
214 214
 
215 215
     int len = m_iBufferSize1 / m_dllAvUtil.av_get_bytes_per_sample(m_pCodecContext->sample_fmt);

0 notes on commit 269b609

Please sign in to comment.
Something went wrong with that request. Please try again.