The new chlayout API has been introduced in FFmpeg 5.1. Use the old channel_layout API on older versions.