Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ActiveAE: verify resample context before using it

  • Loading branch information...
commit d91cb68ecce39ca73e32ab7adc0d60a3699ab709 1 parent 6dff1d3
@FernetMenta FernetMenta authored
Showing with 7 additions and 5 deletions.
  1. +7 −5 xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResample.cpp
View
12 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
Please sign in to comment.
Something went wrong with that request. Please try again.