Permalink
Browse files

Merge pull request #4510 from FernetMenta/aefixes

ActiveAE: verify resample context before using it
  • Loading branch information...
2 parents 86f4e31 + d91cb68 commit 6eb8ce115c6897c224923c1f810425cceb6306cb @jmarshallnz jmarshallnz committed Apr 4, 2014
Showing with 7 additions and 5 deletions.
  1. +7 −5 xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp
@@ -63,6 +63,13 @@ bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst
m_pContext = m_dllSwResample.swr_alloc_set_opts(NULL, m_dst_chan_layout, m_dst_fmt, m_dst_rate,
m_src_chan_layout, m_src_fmt, m_src_rate,
0, NULL);
+
+ if(!m_pContext)
+ {
+ CLog::Log(LOGERROR, "CActiveAEResample::Init - create context failed");
+ return false;
+ }
+
if(quality == AE_QUALITY_HIGH)
{
m_dllAvUtil.av_opt_set_double(m_pContext, "cutoff", 1.0, 0);
@@ -94,11 +101,6 @@ bool CActiveAEResample::Init(uint64_t dst_chan_layout, int dst_channels, int dst
m_dllAvUtil.av_opt_set_double(m_pContext, "rematrix_maxval", 1.0, 0);
}
- if(!m_pContext)
- {
- CLog::Log(LOGERROR, "CActiveAEResample::Init - create context failed");
- return false;
- }
if (remapLayout)
{
// one-to-one mapping of channels

0 comments on commit 6eb8ce1

Please sign in to comment.