Added code to accommodate the absence of swresample