Add helper function _check_frames_and_channels()