DVDAudioCodecFFmpeg: Make sure swr resampler gets reinited when channel count changes
authorfritsch <peter.fruehberger@gmail.com>
Wed, 29 May 2013 19:35:26 +0000 (21:35 +0200)
committerfritsch <peter.fruehberger@gmail.com>
Wed, 29 May 2013 19:36:57 +0000 (21:36 +0200)
xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp

index efae6eb..41675e3 100644 (file)
@@ -192,7 +192,7 @@ void CDVDAudioCodecFFmpeg::ConvertToFloat()
 {
   if(m_pCodecContext->sample_fmt != AV_SAMPLE_FMT_FLT && m_iBufferSize1 > 0)
   {
-    if(m_pConvert && m_pCodecContext->sample_fmt != m_iSampleFormat)
+    if(m_pConvert && (m_pCodecContext->sample_fmt != m_iSampleFormat || m_channels != m_pCodecContext->channels))
       m_dllSwResample.swr_free(&m_pConvert);
 
     if(!m_pConvert)