From 7c4418ab47ab8c565abeb54d3567c32aa07e376c Mon Sep 17 00:00:00 2001 From: AchimTuran Date: Sun, 30 Oct 2016 08:11:03 +0100 Subject: [PATCH] [DSPProcessFreeSurround] Fix decoder creation and return 0 samples if an error occured --- src/DSPProcessFreeSurround.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DSPProcessFreeSurround.cpp b/src/DSPProcessFreeSurround.cpp index c7e910d..fdd6f3b 100644 --- a/src/DSPProcessFreeSurround.cpp +++ b/src/DSPProcessFreeSurround.cpp @@ -92,7 +92,7 @@ AE_DSP_ERROR CDSPProcess_FreeSurround::StreamInitialize(const AE_DSP_SETTINGS *s m_DecoderChannelSetup = (channel_setup)(settings->lOutChannelPresentFlags | AE_DSP_PRSNT_CH_LFE); - if (!m_Decoder) + if (m_Decoder) delete m_Decoder; m_Decoder = new CFreeSurroundDecoder(m_DecoderChannelSetup, default_block_size, m_SampleRate); @@ -169,7 +169,7 @@ float CDSPProcess_FreeSurround::StreamGetDelay() unsigned int CDSPProcess_FreeSurround::StreamProcess(const float **array_in, float **array_out, unsigned int samples) { if (!m_Decoder) - return samples; + return 0; float **outputs = m_Decoder->getOutputBuffers();