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)