transcode: simplify codec detection code