Simplify the use of swr_convert and add #ifdef guards around code that require libswresample.