Refactored check for audio and video codecs