From 00eae6266371de2a3dcecc0dd38cde2cbc49646a Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Sun, 8 Mar 2015 22:22:40 -0500 Subject: [PATCH] Fixed an issue with a crashing unit test, and a broken ChangeMapping() method on the FrameMapper. --- src/FrameMapper.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/FrameMapper.cpp b/src/FrameMapper.cpp index ce617d1d..6dde631b 100644 --- a/src/FrameMapper.cpp +++ b/src/FrameMapper.cpp @@ -577,6 +577,16 @@ void FrameMapper::ChangeMapping(Fraction target_fps, PulldownType target_pulldow info.channels = target_channels; info.channel_layout = target_channel_layout; + // Clear cache + final_cache.Clear(); + + // Deallocate resample buffer + if (avr) { + avresample_close(avr); + avresample_free(&avr); + avr = NULL; + } + } // Resample audio and map channels (if needed)