I second the motion for shellac based sealer. My wife and I bought our first house a long time ago. It had wall to wall carpeting in one of the bedrooms. Funky smell. I ripped up the carpet and found several urine soaked areas. After drying out and light sanding, a couple of coats of shellac completely blocked the smell. New paint on the walls and ceiling and new WW carpeting and it was ready for our first kid.
I‘m a big fan of shellac based sealer for killing smells, stains and for sealing off knots when painting wood like knotty pine.