This is needed if a custom matrix is set by the user after opening the AVAudioResampleContext because the matrix channel count can change if different mixing coefficients are used. CC:libav-stable@libav.org