@doublex fix for sources that contain codec information. #781

Implements @doublex's suggested fix for issue #781.