diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2012-12-16 13:10:33 +0400 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2012-12-16 13:10:33 +0400 |
commit | bc29962c0c34085628d9d76ad628908aea17a69a (patch) | |
tree | 28785e596d4dbb963ca56ae577416d43d0b7b360 | |
parent | c592b3244647f66484f68d3eb33747c9d5c8ed08 (diff) |
Open resample context after setting all properties.
-rw-r--r-- | decoder/LAVAudio/PostProcessor.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/decoder/LAVAudio/PostProcessor.cpp b/decoder/LAVAudio/PostProcessor.cpp index eb34fe26..e6acf4a6 100644 --- a/decoder/LAVAudio/PostProcessor.cpp +++ b/decoder/LAVAudio/PostProcessor.cpp @@ -591,13 +591,6 @@ HRESULT CLAVAudio::PerformMixing(BufferDetails *buffer) av_opt_set_int(m_avrContext, "clip_protection", !bNormalize && (m_settings.MixingFlags & LAV_MIXING_FLAG_CLIP_PROTECTION), 0); - // Open Resample Context - ret = avresample_open(m_avrContext); - if (ret < 0) { - DbgLog((LOG_ERROR, 10, L"avresample_open failed, layout in: %x, out: %x, sample fmt in: %d, out: %d", buffer->dwChannelMask, dwMixingLayout, buffer->sfFormat, m_sfRemixFormat)); - goto setuperr; - } - // Create Matrix int in_ch = buffer->wChannels; int out_ch = av_get_channel_layout_nb_channels(dwMixingLayout); @@ -621,6 +614,13 @@ HRESULT CLAVAudio::PerformMixing(BufferDetails *buffer) goto setuperr; } + // Open Resample Context + ret = avresample_open(m_avrContext); + if (ret < 0) { + DbgLog((LOG_ERROR, 10, L"avresample_open failed, layout in: %x, out: %x, sample fmt in: %d, out: %d", buffer->dwChannelMask, dwMixingLayout, buffer->sfFormat, m_sfRemixFormat)); + goto setuperr; + } + m_dwRemixLayout = dwMixingLayout; } |